﻿using System;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
using HRM.HRMServiceProxy;
using HRM.BusinessLogic;

namespace HRM
{
    public partial class frmCR : Form
    {
        DialogResult dlgResult;

        CandidateInfo _CandidateInfo;
        CCInfo _CCInfo;
        CWBInfo _CWBInfo;
        CFamilyInfo _CFamilyInfo;
        CLanguageInfo _CLanguageInfo;
        CCriteriaInfo _CCriteriaInfo1;
        CCriteriaInfo _CCriteriaInfo2;
        CCriteriaInfo _CCriteriaInfo3;
        CInterviewInfo _CInterviewInfo;
        CRInfo _CRInfo;
        RecruitmentInfo _RecruitmentInfo;
        EmployeeInfo _EmployeeInfo;
        PositionDetailInfo _PositionDetailInfo;

        CandidateClient _wcfCandidate;
        CCClient _wcfCC;
        CWBClient _wcfCWB;
        CFamilyClient _wcfCFamily;
        CLanguageClient _wcfCLanguage;
        CCriteriaClient _wcfCCriteria;
        CInterviewClient _wcfCInterview;
        CRClient _wcfCR;
        RecruitmentClient _wcfRecruitment;
        EmployeeClient _wcfEmployee;
        PositionDetailClient _wcfPositionDetail;

        int _InterviewID1 = 0;
        int _InterviewID2 = 0;
        int _InterviewID3 = 0;
        int _RecruitmentID = 0;
        int _CRID = 0;
        RoleRightInfo listRole;
        public frmCR(int CRID, int RecruitmentID, RoleRightInfo _listRole)
        {
            InitializeComponent();
            this.KeyPreview = true;
            dlgResult = DialogResult.Cancel;
            try
            {
                LoadLanguage();
                LoadStandard();
                _wcfCandidate = Service.Candidate();
                _wcfCC = Service.CC();
                _wcfCWB = Service.CWB();
                _wcfCFamily = Service.CFamily();
                _wcfCLanguage = Service.CLanguage();
                _wcfCCriteria = Service.CCriteria();
                _wcfCInterview = Service.CInterview();
                _wcfCR = Service.CR();
                _wcfRecruitment = Service.Recruitment();
                _wcfEmployee = Service.Employee();
                _wcfPositionDetail = Service.PositionDetail();

                _CandidateInfo = new CandidateInfo();
                _CCInfo = new CCInfo();
                _CWBInfo = new CWBInfo();
                _CFamilyInfo = new CFamilyInfo();
                _CLanguageInfo = new CLanguageInfo();
                _CCriteriaInfo1 = new CCriteriaInfo();
                _CCriteriaInfo2 = new CCriteriaInfo();
                _CCriteriaInfo3 = new CCriteriaInfo();
                _CInterviewInfo = new CInterviewInfo();
                _PositionDetailInfo = new PositionDetailInfo();
                _EmployeeInfo = new EmployeeInfo();
                tabCandidate.TabPages.Remove(tpphongvan2);
                tabCandidate.TabPages.Remove(tpphongvan3);
                _CRInfo = new CRInfo();
                _RecruitmentInfo = new RecruitmentInfo();
                txtCode.Text = _wcfCandidate.Candidate_AutoCreateCode().No;
                UISetting.LoadMeritalStatus(ref cboMaritalStatus);
                UISetting.LoadReligion(ref cboReligion);
                UISetting.LoadEthnic(ref cboEthlic);
                UISetting.LoadDepartment(ref cboLocate);
                UISetting.LoadPosition(ref cboCInterview1_Position);
                UISetting.LoadPosition(ref cboCInterview2_Position);
                UISetting.LoadPosition(ref cboCInterview3_Position);
                UISetting.LoadDepartment(ref cboCInterview2_DepartmentOffer);
                UISetting.LoadPosition(ref cboCInterview2_PositionOffer);
                UISetting.LoadPosition(ref cboPosition);
                UISetting.LoadPosition(ref cboPositionCandidate);
                UISetting.LoadAbility(ref mcbCLanguage_SelfRating);
                UISetting.LoadAbility(ref mcbCLanguage_CommentsOfInterview);
                UISetting.LoadYears(ref cboYear);
                UISetting.LoadRecruitment(ref cboRecruitment, Convert.ToInt32(cboYear.SelectedValue));
                UISetting.NapTrangThaiDuyet(ref cboDuyet1);
                cboDuyet1.SelectedValue = 0;
                //UISetting.NapTrangThaiDuyet(ref cboDuyet2);
                //cboDuyet2.SelectedValue = 0;
                //UISetting.NapTrangThaiDuyet(ref cboDuyet3);
                //cboDuyet3.SelectedValue = 0;
                UISetting.NapTrangThaiHoSo(ref cboStatus);
                if (RecruitmentID > 0)
                    cboRecruitment.SelectedValue = RecruitmentID;
                _RecruitmentID = RecruitmentID;
                _CRID = CRID;
                listRole = _listRole;

                if (CRID > 0)
                {
                    _CRInfo = _wcfCR.CR_GetInfo(CRID);
                    CROut();
                    _CandidateInfo = _wcfCandidate.Candidate_GetInfo(_CRInfo.CandidateID);
                    PersonalOut();
                    _CandidateInfo.ID = _CRInfo.CandidateID;

                    CCriteriaOut();

                    if (_wcfCInterview.CInterview_GetInfo(_CandidateInfo.ID, _CRInfo.RecruitmentID, 1) != null)
                    {
                        _CInterviewInfo = _wcfCInterview.CInterview_GetInfo(_CandidateInfo.ID, _CRInfo.RecruitmentID, 1);
                        _InterviewID1 = _CInterviewInfo.ID;
                        Overall1Out();
                    }

                    if (_wcfCInterview.CInterview_GetInfo(_CandidateInfo.ID, _CRInfo.RecruitmentID, 2) != null)
                    {
                        _CInterviewInfo = _wcfCInterview.CInterview_GetInfo(_CandidateInfo.ID, _CRInfo.RecruitmentID, 2);
                        _InterviewID2 = _CInterviewInfo.ID;
                        Overall2Out();
                    }

                    if (_wcfCInterview.CInterview_GetInfo(_CandidateInfo.ID, _CRInfo.RecruitmentID, 3) != null)
                    {
                        _CInterviewInfo = _wcfCInterview.CInterview_GetInfo(_CandidateInfo.ID, _CRInfo.RecruitmentID, 3);
                        _InterviewID3 = _CInterviewInfo.ID;
                        Overall3Out();
                    }
                    if (_CRInfo.Status == 8) //"Trúng tuyển"
                    {
                        btnSelectCandidate.Enabled = false;
                        btnSave.Enabled = false;
                        btnOk.Enabled = false;
                        cboDuyet1.Enabled = false;
                        cboDuyet2.Enabled = false;
                        cboDuyet3.Enabled = false;
                        cboStatus.SelectedValue = 8;
                    }
                    else if (_CRInfo.Status == 6)
                    {
                        btnSelectCandidate.Enabled = false;
                        btnSave.Enabled = false;
                        cboDuyet1.Enabled = false;
                        cboDuyet2.Enabled = false;
                        cboDuyet3.Enabled = false;
                    }
                    else if (_CRInfo.Status == 3 || _CRInfo.Status == 5 || _CRInfo.Status == 7)
                    {
                        btnSelectCandidate.Enabled = false;
                        btnSave.Enabled = false;
                        btnOk.Enabled = false;
                        cboDuyet1.Enabled = false;
                        cboDuyet2.Enabled = false;
                        cboDuyet3.Enabled = false;
                    }
                    LoadData_CC();
                    LoadData_CWB();
                    LoadData_CFamily();
                    LoadData_CLanguage();

                }
                _CRInfo.ID = CRID;

                dgvCC.CellClick += new DataGridViewCellEventHandler(dgvCC1_CellClick);
                dgvCWB.CellClick += new DataGridViewCellEventHandler(dgvCWB1_CellClick);
                dgvCFamily.CellClick += new DataGridViewCellEventHandler(dgvCFamily1_CellClick);
                dgvCLanguage.CellClick += new DataGridViewCellEventHandler(dgvCLanguage1_CellClick);
            }
            catch (Exception ex)
            {
                MessageBox.Show(UpdateUI.GetString("loi") + ":\n" + ex.Message + "\n" + UpdateUI.GetString("ghiloi"));
            }
        }

        void LoadStandard()
        {
            StandardClient wcfStandard = Service.Standard();
            DataTable dt = wcfStandard.Standard_GetAll().Tables[0];
            DataRow dr = dt.NewRow();
            dr["Standard_ID"] = 0;
            dr["Standard_Name"] = "";
            dt.Rows.InsertAt(dr, 0);
            cboStandard.DataSource = null;
            cboStandard.DisplayMember = "Standard_Name";
            cboStandard.ValueMember = "Standard_ID";
            cboStandard.DataSource = dt;
        }

        #region CandidateRecruitment (CR)
        private void CRIn()
        {
            _CRInfo.CandidateID = Convert.ToInt32(txtCode.Tag);
            _CRInfo.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
            _CRInfo.Year = Convert.ToInt32(cboYear.SelectedValue);
            _CRInfo.Status = Convert.ToInt32(cboStatus.SelectedValue);
        }
        private void CROut()
        {
            txtCode.Tag = _CRInfo.CandidateID;
            cboYear.SelectedValue = _CRInfo.Year;
            cboRecruitment.SelectedValue = _CRInfo.RecruitmentID;
            cboStatus.SelectedValue = _CRInfo.Status;
        }
        #endregion

        #region Personal

        private void PersonalOut()
        {
            try
            {
                txtCode.Tag = _CandidateInfo.ID;
                txtCode.Text = _CandidateInfo.No;
                txtFirstName.Text = _CandidateInfo.FirstName;
                txtLastName.Text = _CandidateInfo.LastName;
                txtAlias.Text = _CandidateInfo.Alias;
                cboStandard.SelectedValue = _CandidateInfo.Education;
                mtxBirthday.Text = _CandidateInfo.DateOfBirth.ToString("dd/MM/yyyy");
                txtBirthPlace.Text = _CandidateInfo.PlaceOfBirth;
                txtAddress.Text = _CandidateInfo.Address;
                txtPhone.Text = _CandidateInfo.Phone;

                rdnMale.Checked = _CandidateInfo.Sex;
                rdnFemale.Checked = !rdnMale.Checked;

                cboMaritalStatus.SelectedValue = Convert.ToInt32(_CandidateInfo.MaterialStatusID);
                cboEthlic.SelectedValue = Convert.ToInt32(_CandidateInfo.EthlicID);
                cboReligion.SelectedValue = Convert.ToInt32(_CandidateInfo.ReligionID);
                txtIDCardNo.Text = _CandidateInfo.IDCardNo;
                mtxIDCardIssueDate.Text = _CandidateInfo.IDCardIssueDate == DateTime.MinValue ? "" : Convert.ToDateTime(_CandidateInfo.IDCardIssueDate).ToString("dd/MM/yyyy");
                txtIDCardIssueAuthority.Text = _CandidateInfo.IDCardIssueAuthority;
                mtxDate.Text = _CandidateInfo.Date == DateTime.MinValue ? "" : Convert.ToDateTime(_CandidateInfo.Date).ToString("dd/MM/yyyy");

                if (_CandidateInfo.ResidentOfHaNoi == 1)
                    rdnResidentYes.Checked = true;
                else if (_CandidateInfo.ResidentOfHaNoi == 0)
                    rdnResidentNo.Checked = true;
                else
                {
                    rdnResidentYes.Checked = false;
                    rdnResidentNo.Checked = false;
                }


                cboTransport.Text = _CandidateInfo.TransportMeans;
                txtDescription.Text = _CandidateInfo.Description;
                cboLocate.SelectedValue = Convert.ToInt32(_CandidateInfo.DepartmentID);
                cboPosition.SelectedValue = Convert.ToInt32(_CandidateInfo.PositionID);
                mtxWhenAvailable.Text = _CandidateInfo.WhenAvailable == DateTime.MinValue ? "" : Convert.ToDateTime(_CandidateInfo.WhenAvailable).ToString("dd/MM/yyyy");
                txtMinSalaryExpected.Text = Convert.ToDecimal(_CandidateInfo.MinSalaryExpected).ToString("#,##0");

                if (_CandidateInfo.WorkOnShift == 1)
                    rdnWorkOnShiftYes.Checked = true;
                else if (_CandidateInfo.WorkOnShift == 0)
                    rdnWorkOnShiftNo.Checked = true;
                else
                {
                    rdnWorkOnShiftYes.Checked = false;
                    rdnWorkOnShiftNo.Checked = false;
                }

                chkSpecialSkill1.Checked = _CandidateInfo.SpecialSkill.Contains("Đánh máy") ? true : false;
                chkSpecialSkill2.Checked = _CandidateInfo.SpecialSkill.Contains("Sử dụng máy tính") ? true : false;
                chkSpecialSkill3.Checked = _CandidateInfo.SpecialSkill.Contains("Kỹ năng viết") ? true : false;
                chkSpecialSkill4.Checked = _CandidateInfo.SpecialSkill.Contains("Kỹ năng khác") ? true : false;

                if (_CandidateInfo.Acquaintance == 1)
                    rdnAcquaintanceY.Checked = true;
                else if (_CandidateInfo.Acquaintance == 0)
                    rdnAcquaintanceN.Checked = true;
                else
                {
                    rdnAcquaintanceY.Checked = false;
                    rdnAcquaintanceN.Checked = false;
                }



                txtAcquaintanceName.Text = _CandidateInfo.AcquaintanceName;


                if (_CandidateInfo.PartimeCourse == 1)
                    rdnPartimeCourseY.Checked = true;
                else if (_CandidateInfo.PartimeCourse == 0)
                    rdnPartimeCourseN.Checked = true;
                else
                {
                    rdnPartimeCourseY.Checked = false;
                    rdnPartimeCourseN.Checked = false;
                }

                txtCourseName.Text = _CandidateInfo.CourseName;
                txtCourseTime.Text = _CandidateInfo.CourseTime.ToString();
                txtFinancialController.Text = _CandidateInfo.FinancialController;
                mtxSalaryDate.Text = _CandidateInfo.SalaryDate == DateTime.MinValue ? "" : Convert.ToDateTime(_CandidateInfo.SalaryDate).ToString("dd/MM/yyyy");
                mtxProbationStartDate.Text = _CandidateInfo.ProbationStartDate == DateTime.MinValue ? "" : Convert.ToDateTime(_CandidateInfo.ProbationStartDate).ToString("dd/MM/yyyy");
                txtProbationPeriod.Text = Convert.ToInt32(_CandidateInfo.ProbationPeriod).ToString();
                txtProbationSalary.Text = Convert.ToDecimal(_CandidateInfo.ProbationSalary).ToString("#,##0");
                txtTraningSalary.Text = Convert.ToDecimal(_CandidateInfo.TraningSalary).ToString("#,##0");
                txtConfomationSalary.Text = Convert.ToDecimal(_CandidateInfo.ConfomationSalary).ToString("#,##0");
                txtOthers.Text = _CandidateInfo.Others;
            }
            catch (Exception ex)
            {
                MessageBox.Show(UpdateUI.GetString("loi") + ":\n" + ex.Message + "\n" + UpdateUI.GetString("ghiloi"));
            }

        }
        private void PersonalIn()
        {
            try
            {
                _CandidateInfo.No = txtCode.Text.Trim();
                _CandidateInfo.FirstName = txtFirstName.Text.Trim();
                _CandidateInfo.LastName = txtLastName.Text.Trim();
                _CandidateInfo.Alias = txtAlias.Text.Trim();
                _CandidateInfo.Education = cboStandard.SelectedValue.ToString();
                _CandidateInfo.DateOfBirth = UISetting.GetDate(mtxBirthday.Text);
                _CandidateInfo.PlaceOfBirth = txtBirthPlace.Text;
                _CandidateInfo.Address = txtAddress.Text;
                _CandidateInfo.Phone = txtPhone.Text;
                _CandidateInfo.Sex = rdnMale.Checked;
                _CandidateInfo.MaterialStatusID = Convert.ToInt32(cboMaritalStatus.SelectedValue);
                _CandidateInfo.EthlicID = Convert.ToInt32(cboEthlic.SelectedValue);
                _CandidateInfo.ReligionID = Convert.ToInt32(cboReligion.SelectedValue);
                _CandidateInfo.IDCardNo = txtIDCardNo.Text;
                _CandidateInfo.IDCardIssueDate = UISetting.GetDate(mtxIDCardIssueDate.Text);
                _CandidateInfo.IDCardIssueAuthority = txtIDCardIssueAuthority.Text;
                _CandidateInfo.Date = UISetting.GetDate(mtxDate.Text);
                if (rdnResidentYes.Checked)
                    _CandidateInfo.ResidentOfHaNoi = 1;
                else if (rdnResidentNo.Checked)
                    _CandidateInfo.ResidentOfHaNoi = 0;
                else
                    _CandidateInfo.ResidentOfHaNoi = 2;
                _CandidateInfo.TransportMeans = cboTransport.Text;
                _CandidateInfo.Description = txtDescription.Text;
                _CandidateInfo.PositionID = Convert.ToInt32(cboPosition.SelectedValue);
                _CandidateInfo.DepartmentID = Convert.ToInt32(cboLocate.SelectedValue);
                _CandidateInfo.WhenAvailable = UISetting.GetDate(mtxWhenAvailable.Text);
                _CandidateInfo.MinSalaryExpected = UISetting.GetDecimalNo(txtMinSalaryExpected.Text);
                if (rdnWorkOnShiftYes.Checked)
                    _CandidateInfo.WorkOnShift = 1;
                else if (rdnWorkOnShiftNo.Checked)
                    _CandidateInfo.WorkOnShift = 0;
                else
                    _CandidateInfo.WorkOnShift = 2;

                _CandidateInfo.SpecialSkill = SetSpecialSkill();

                if (rdnAcquaintanceY.Checked)
                    _CandidateInfo.Acquaintance = 1;
                else if (rdnAcquaintanceN.Checked)
                    _CandidateInfo.Acquaintance = 0;
                else
                    _CandidateInfo.Acquaintance = 2;


                _CandidateInfo.AcquaintanceName = txtAcquaintanceName.Text;


                if (rdnPartimeCourseY.Checked)
                    _CandidateInfo.PartimeCourse = 1;
                else if (rdnPartimeCourseN.Checked)
                    _CandidateInfo.PartimeCourse = 0;
                else
                    _CandidateInfo.PartimeCourse = 2;
                _CandidateInfo.CourseName = txtCourseName.Text;
                _CandidateInfo.CourseTime = UISetting.GetIntNo(txtCourseTime.Text);
                _CandidateInfo.FinancialController = txtFinancialController.Text;
                _CandidateInfo.SalaryDate = UISetting.GetDate(mtxSalaryDate.Text);
                _CandidateInfo.ProbationStartDate = UISetting.GetDate(mtxProbationStartDate.Text);
                _CandidateInfo.ProbationPeriod = UISetting.GetIntNo(txtProbationPeriod.Text);
                _CandidateInfo.ProbationSalary = UISetting.GetDecimalNo(txtProbationSalary.Text);
                _CandidateInfo.TraningSalary = UISetting.GetDecimalNo(txtTraningSalary.Text);
                _CandidateInfo.ConfomationSalary = UISetting.GetDecimalNo(txtConfomationSalary.Text);
                _CandidateInfo.Others = txtOthers.Text;
            }
            catch (Exception ex)
            {
                MessageBox.Show(UpdateUI.GetString("loi") + ":\n" + ex.Message + "\n" + UpdateUI.GetString("ghiloi"));
            }
        }
        string SetSpecialSkill()
        {
            string _str = "";
            if (chkSpecialSkill1.Checked)
                _str = "Đánh máy";
            if (chkSpecialSkill2.Checked)
                _str = _str == "" ? _str + "Sử dụng máy tính" : _str + ",Sử dụng máy tính";
            if (chkSpecialSkill3.Checked)
                _str = _str == "" ? _str + "Kỹ năng viết" : _str + ",Kỹ năng viết";
            if (chkSpecialSkill4.Checked)
                _str = _str == "" ? _str + "Kỹ năng khác" : _str + ",Kỹ năng khác";
            return _str;
        }
        private bool CheckValidPersonal()
        {
            if (txtCode.Text.Trim().Length == 0)
            {
                tabCandidate.SelectedTab = tabPage1;
                txtCode.Focus();
                MessageBox.Show(UpdateUI.GetString("masokhongduoctrong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            if (txtLastName.Text.Trim().Length == 0)
            {
                tabCandidate.SelectedTab = tabPage1;
                txtLastName.Focus();
                MessageBox.Show(UpdateUI.GetString("hotrong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            if (txtFirstName.Text.Trim().Length == 0)
            {
                tabCandidate.SelectedTab = tabPage1;
                txtFirstName.Focus();
                MessageBox.Show(UpdateUI.GetString("tentrong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }

            if (!rdnMale.Checked && !rdnFemale.Checked)
            {
                tabCandidate.SelectedTab = tabPage1;
                MessageBox.Show(UpdateUI.GetString("chuachongioitinh"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            if (UISetting.GetDate(mtxBirthday.Text) == DateTime.MinValue)
            {
                tabCandidate.SelectedTab = tabPage1;
                mtxBirthday.Focus();
                MessageBox.Show(UpdateUI.GetString("ngaysinhkhonghople"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            if (UISetting.GetDate(mtxIDCardIssueDate.Text) != DateTime.MinValue)
            {
                if (DateTime.Compare(UISetting.GetDate(mtxBirthday.Text), UISetting.GetDate(mtxIDCardIssueDate.Text)) >= 0)
                {
                    tabCandidate.SelectedTab = tabPage1;
                    mtxIDCardIssueDate.Focus();
                    MessageBox.Show(UpdateUI.GetString("ngaycapphaimuonhonnaysinh"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return false;
                }
            }
            if (UISetting.GetDate(mtxDate.Text) == DateTime.MinValue)
            {
                tabCandidate.SelectedTab = tabPage1;
                mtxDate.Focus();
                MessageBox.Show(UpdateUI.GetString("ngaynophosokhonghople"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            else
            {
                if (DateTime.Compare(UISetting.GetDate(mtxBirthday.Text), UISetting.GetDate(mtxDate.Text)) >= 0)
                {
                    tabCandidate.SelectedTab = tabPage1;
                    mtxDate.Focus();
                    MessageBox.Show(UpdateUI.GetString("ngaynopphaimuonhongaysinh"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return false;
                }

            }
            if (Convert.ToInt32(cboStatus.SelectedValue) == 6)
            {
                if (Convert.ToInt32(cboLocate.SelectedValue) == 0 || Convert.ToInt32(cboPosition.SelectedValue) == 0)
                {
                    MessageBox.Show(UpdateUI.GetString("chuachonchucvuvavitridexuat"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    tabCandidate.SelectedTab = tpluong;
                    return false;
                }
                //if (txtConfomationSalary.Text)
                //{
                //    Program.taskbarNotifier.Show(UIParamater.TitleProject, UpdateUI.GetString("chuachonchucvuvavitridexuat"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                //    tabCandidate.SelectedTab = tpluong;
                //    return false;
                //}

            }

            return true;
        }

        private void txtMinSalaryExpected_Leave(object sender, EventArgs e)
        {
            txtMinSalaryExpected.Text = UISetting.GetDecimalNo(txtMinSalaryExpected.Text).ToString("#,##0");
        }
        private void txtTraningSalary_Leave(object sender, EventArgs e)
        {
            txtTraningSalary.Text = UISetting.GetDecimalNo(txtTraningSalary.Text).ToString("#,##0");
        }

        private void txtProbationSalary_Leave(object sender, EventArgs e)
        {
            txtProbationSalary.Text = UISetting.GetDecimalNo(txtProbationSalary.Text).ToString("#,##0");
        }

        private void txtConfomationSalary_Leave(object sender, EventArgs e)
        {
            txtConfomationSalary.Text = UISetting.GetDecimalNo(txtConfomationSalary.Text).ToString("#,##0");
        }
        #endregion

        #region CC (Academic)

        int itemCount_CC = 0;
        int currPage_CC = 0;
        int pageSize = 100;

        private void LoadData_CC()
        {
            try
            {
                DataSet _ds = _wcfCC.CC_GetList(out itemCount_CC, _CandidateInfo.ID, currPage_CC, pageSize);
                dgvCC.Rows.Clear();
                for (int i = 0; i < _ds.Tables[0].Rows.Count; i++)
                {
                    dgvCC.Rows.Insert(i, 1);
                    dgvCC.Rows[i].Cells["CC_ID"].Value = _ds.Tables[0].Rows[i]["CC_ID"].ToString();
                    dgvCC.Rows[i].Cells["CC_RowNumber"].Value = _ds.Tables[0].Rows[i]["RowNumber"].ToString();
                    dgvCC.Rows[i].Cells["CC_Name"].Value = _ds.Tables[0].Rows[i]["CC_Name"].ToString();
                    dgvCC.Rows[i].Cells["CC_AuthorityIssue"].Value = _ds.Tables[0].Rows[i]["CC_AuthorityIssue"].ToString();
                    if (_ds.Tables[0].Rows[i]["CC_IssueDate"] != DBNull.Value)
                        dgvCC.Rows[i].Cells["CC_IssueDate"].Value = Convert.ToDateTime(_ds.Tables[0].Rows[i]["CC_IssueDate"]).ToString("dd/MM/yyyy");
                    else
                        dgvCC.Rows[i].Cells["CC_IssueDate"].Value = DateTime.MinValue;
                    if (_ds.Tables[0].Rows[i]["CC_FromDate"] != DBNull.Value)
                        dgvCC.Rows[i].Cells["CC_FromDate"].Value = Convert.ToDateTime(_ds.Tables[0].Rows[i]["CC_FromDate"]).ToString("dd/MM/yyyy");
                    else
                        dgvCC.Rows[i].Cells["CC_FromDate"].Value = DateTime.MinValue;
                    if (_ds.Tables[0].Rows[i]["CC_ToDate"] != DBNull.Value)
                        dgvCC.Rows[i].Cells["CC_ToDate"].Value = Convert.ToDateTime(_ds.Tables[0].Rows[i]["CC_ToDate"]).ToString("dd/MM/yyyy");
                    else
                        dgvCC.Rows[i].Cells["CC_ToDate"].Value = DateTime.MinValue;
                    dgvCC.Rows[i].Cells["CC_Grade"].Value = _ds.Tables[0].Rows[i]["CC_Grade"].ToString();
                    dgvCC.Rows[i].Cells["CC_Speciality"].Value = _ds.Tables[0].Rows[i]["CC_Speciality"].ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(UpdateUI.GetString("loi") + ":\n" + ex.Message + "\n" + UpdateUI.GetString("ghiloi"));
            }
        }
        private bool CheckValidCC()
        {
            if (_CandidateInfo.ID == 0)
            {
                MessageBox.Show(UpdateUI.GetString("chualuuthongtincanhan"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            if (txtCC_AuthorityIssue.Text.Trim().Length == 0)
            {
                txtCC_AuthorityIssue.Focus();
                MessageBox.Show(UpdateUI.GetString("tentruongtrong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }

            if (UISetting.GetDate(mtxCC_FromDate.Text) == DateTime.MinValue)
            {
                mtxCC_FromDate.Focus();

                MessageBox.Show(UpdateUI.GetString("ngaybatdaukhonghople"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            if (UISetting.GetDate(mtxCC_ToDate.Text) == DateTime.MinValue)
            {
                mtxCC_FromDate.Focus();
                MessageBox.Show(UpdateUI.GetString("ngayketthuckhonghople"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            else
            {
                if (DateTime.Compare(UISetting.GetDate(mtxCC_FromDate.Text), UISetting.GetDate(mtxCC_ToDate.Text)) >= 0)
                {
                    mtxCC_ToDate.Focus();
                    MessageBox.Show(UpdateUI.GetString("ngayketthucphaimuonhonngaybatdau"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return false;
                }
            }
            if (txtCC_Grade.Text.Trim().Length == 0)
            {
                txtCC_Grade.Focus();
                MessageBox.Show(UpdateUI.GetString("trinhdokhongduocdetrong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            return true;
        }
        private void btnCCNew_Click(object sender, EventArgs e)
        {
            _CCInfo.ID = 0;
            txtCC_AuthorityIssue.Text = "";
            txtCC_Grade.Text = "";
            mtxCC_IssueDate.Text = "";
            mtxCC_FromDate.Text = "";
            mtxCC_ToDate.Text = "";
            txtCC_Name.Text = "";
            txtCC_Speciality.Text = "";
            txtCC_AuthorityIssue.Focus();
        }
        private void btnCCSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (CheckValidCC())
                {
                    AccdemicIn();
                    if (_CCInfo.ID > 0)//update
                    {
                        if (!listRole.Update)
                        {
                            MessageBox.Show(UpdateUI.GetString("khongcoquyencapnhat"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                        if (_wcfCC.CC_Exist(_CCInfo.ID, _CCInfo.CandidateID, txtCC_AuthorityIssue.Text.Trim()))
                        {
                            MessageBox.Show(UpdateUI.GetString("datontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                        if (_wcfCC.CC_Update(_CCInfo))
                        {

                            Program.taskbarNotifier.Show(UpdateUI.GetString("thongbao"), UpdateUI.GetString("capnhatthanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                            LoadData_CC();
                        }
                        else
                            MessageBox.Show(UpdateUI.GetString("capnhatkhongthanhcong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);

                    }
                    else
                    {
                        if (!listRole.Create)
                        {
                            MessageBox.Show(UpdateUI.GetString("khongcoquyenthemmoi"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                        if (_wcfCC.CC_Exist(_CCInfo.ID, _CCInfo.CandidateID, txtCC_AuthorityIssue.Text.Trim()))
                        {
                            MessageBox.Show(UpdateUI.GetString("datontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                        _CCInfo.ID = _wcfCC.CC_Insert(_CCInfo);
                        if (_CCInfo.ID > 0)
                        {
                            Program.taskbarNotifier.Show(UpdateUI.GetString("thongbao"), UpdateUI.GetString("themmoithanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                            LoadData_CC();
                        }
                        else
                            MessageBox.Show(UpdateUI.GetString("themmoikhongthanhcong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    dgvCC_CellClick(null, null);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(UpdateUI.GetString("loi") + ":\n" + ex.Message + "\n" + UpdateUI.GetString("ghiloi"));
            }
        }
        private void dgvCC1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!listRole.Delete)
            {
                MessageBox.Show(UpdateUI.GetString("khongcoquyenxoa"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (e.RowIndex < 0 || e.ColumnIndex !=
                    dgvCC.Columns["CC_Command"].Index) return;
            int CCID = Convert.ToInt32(dgvCC.CurrentRow.Cells["CC_ID"].Value);
            if (MessageBox.Show(UpdateUI.GetString("bancochacchanxoa"), UIParamater.TitleProject, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                if (_wcfCC.CC_Delete(CCID))
                {
                    Program.taskbarNotifier.Show(UIParamater.TitleProject, UpdateUI.GetString("xoathanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                    LoadData_CC();
                }
                else
                {
                    MessageBox.Show(UpdateUI.GetString("xoakhongthanhcong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            dgvCC_CellClick(null, null);
        }
        private void dgvCC_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dgvCC.SelectedRows.Count > 0)
            {
                int CCID = Convert.ToInt32(dgvCC.CurrentRow.Cells["CC_ID"].Value);
                _CCInfo.ID = CCID;
                ReadFromdgvCC();
                AccdemicOut();
            }
        }
        private void ReadFromdgvCC()
        {

            _CCInfo.AuthorityIssue = dgvCC.CurrentRow.Cells["CC_AuthorityIssue"].Value.ToString();
            _CCInfo.Grade = dgvCC.CurrentRow.Cells["CC_Grade"].Value.ToString();
            _CCInfo.IssueDate = dgvCC.CurrentRow.Cells["CC_IssueDate"].Value == DBNull.Value ? DateTime.MinValue :
               Convert.ToDateTime(dgvCC.CurrentRow.Cells["CC_IssueDate"].Value);
            _CCInfo.FromDate = dgvCC.CurrentRow.Cells["CC_FromDate"].Value == DBNull.Value ? DateTime.MinValue :
               Convert.ToDateTime(dgvCC.CurrentRow.Cells["CC_FromDate"].Value);
            _CCInfo.ToDate = dgvCC.CurrentRow.Cells["CC_ToDate"].Value == DBNull.Value ? DateTime.MinValue :
                Convert.ToDateTime(dgvCC.CurrentRow.Cells["CC_ToDate"].Value);
            _CCInfo.Name = dgvCC.CurrentRow.Cells["CC_Name"].Value.ToString();
            _CCInfo.Speciality = dgvCC.CurrentRow.Cells["CC_Speciality"].Value.ToString();
        }
        private void dgvCC_SelectionChanged(object sender, EventArgs e)
        {
            if (dgvCC.SelectedRows.Count > 0)
            {
                int CCID = Convert.ToInt32(dgvCC.CurrentRow.Cells["CC_ID"].Value);
                if (CCID > 0)
                {
                    _CCInfo.ID = CCID;
                    ReadFromdgvCC();
                }
            }
            else
            {
                _CCInfo.ID = 0;
                _CCInfo.AuthorityIssue = "";
                _CCInfo.Grade = "";
                _CCInfo.IssueDate = DateTime.MinValue;
                _CCInfo.FromDate = DateTime.MinValue;
                _CCInfo.ToDate = DateTime.MinValue;
                _CCInfo.Name = "";
                _CCInfo.Speciality = "";
            }
            AccdemicOut();
        }
        private void AccdemicIn()
        {
            _CCInfo.CandidateID = _CandidateInfo.ID;
            _CCInfo.AuthorityIssue = txtCC_AuthorityIssue.Text;
            _CCInfo.Grade = txtCC_Grade.Text;
            _CCInfo.IssueDate = UISetting.GetDate(mtxCC_IssueDate.Text);
            _CCInfo.FromDate = UISetting.GetDate(mtxCC_FromDate.Text);
            _CCInfo.ToDate = UISetting.GetDate(mtxCC_ToDate.Text);
            _CCInfo.Name = txtCC_Name.Text;
            _CCInfo.Speciality = txtCC_Speciality.Text;
        }
        private void AccdemicOut()
        {
            txtCC_AuthorityIssue.Text = _CCInfo.AuthorityIssue;
            txtCC_Grade.Text = _CCInfo.Grade;
            mtxCC_IssueDate.Text = _CCInfo.IssueDate == DateTime.MinValue ? "" : Convert.ToDateTime(_CCInfo.IssueDate).ToString("dd/MM/yyyy");
            mtxCC_FromDate.Text = _CCInfo.FromDate == DateTime.MinValue ? "" : Convert.ToDateTime(_CCInfo.FromDate).ToString("dd/MM/yyyy");
            mtxCC_ToDate.Text = _CCInfo.ToDate == DateTime.MinValue ? "" : Convert.ToDateTime(_CCInfo.ToDate).ToString("dd/MM/yyyy");
            txtCC_Name.Text = _CCInfo.Name;
            txtCC_Speciality.Text = _CCInfo.Speciality;
        }
        #endregion

        #region CWB (Experience)

        int itemCount_CWB = 0;
        int currPage_CWB = 0;
        private void LoadData_CWB()
        {
            try
            {
                DataSet _ds = _wcfCWB.CWB_GetList(out itemCount_CWB, _CandidateInfo.ID, currPage_CWB, pageSize);
                dgvCWB.Rows.Clear();
                for (int i = 0; i < _ds.Tables[0].Rows.Count; i++)
                {
                    dgvCWB.Rows.Insert(i, 1);
                    dgvCWB.Rows[i].Cells["CWB_ID"].Value = _ds.Tables[0].Rows[i]["CWB_ID"].ToString();
                    dgvCWB.Rows[i].Cells["CWB_RowNumber"].Value = _ds.Tables[0].Rows[i]["RowNumber"].ToString();
                    dgvCWB.Rows[i].Cells["CWB_CompanyName"].Value = _ds.Tables[0].Rows[i]["CWB_CompanyName"].ToString();
                    dgvCWB.Rows[i].Cells["CWB_City"].Value = _ds.Tables[0].Rows[i]["CWB_City"].ToString();
                    if (_ds.Tables[0].Rows[i]["CWB_StartDate"] != DBNull.Value)
                        dgvCWB.Rows[i].Cells["CWB_StartDate"].Value = Convert.ToDateTime(_ds.Tables[0].Rows[i]["CWB_StartDate"]).ToString("dd/MM/yyyy");
                    else
                        dgvCWB.Rows[i].Cells["CWB_StartDate"].Value = DateTime.MinValue;
                    if (_ds.Tables[0].Rows[i]["CWB_EndDate"] != DBNull.Value)
                        dgvCWB.Rows[i].Cells["CWB_EndDate"].Value = Convert.ToDateTime(_ds.Tables[0].Rows[i]["CWB_EndDate"]).ToString("dd/MM/yyyy");
                    else
                        dgvCWB.Rows[i].Cells["CWB_EndDate"].Value = DateTime.MinValue;
                    dgvCWB.Rows[i].Cells["CWB_Position"].Value = _ds.Tables[0].Rows[i]["CWB_Position"].ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(UpdateUI.GetString("loi") + ":\n" + ex.Message + "\n" + UpdateUI.GetString("ghiloi"));
            }
        }
        private bool CheckValidCWB()
        {
            if (_CandidateInfo.ID == 0)
            {
                MessageBox.Show(UpdateUI.GetString("chualuuthongtincanhan"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            if (UISetting.GetDate(mtxCWB_StartDate.Text) == DateTime.MinValue)
            {
                mtxCWB_StartDate.Focus();
                MessageBox.Show(UpdateUI.GetString("ngaybatdaukhonghople"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            else
            {
                if (DateTime.Compare(UISetting.GetDate(mtxCWB_StartDate.Text), UISetting.GetDate(mtxCWB_EndDate.Text)) >= 0)
                {
                    mtxCWB_EndDate.Focus();
                    MessageBox.Show(UpdateUI.GetString("ngayketthucphaimuonhonngaybatdau"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return false;
                }
            }
            if (txtCWBCompanyName.Text.Trim().Length == 0)
            {
                txtCWBCompanyName.Focus();
                MessageBox.Show(UpdateUI.GetString("tencongtykhongduocdetrong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            if (txtCWBCity.Text.Trim().Length == 0)
            {
                txtCWBCity.Focus();
                MessageBox.Show(UpdateUI.GetString("tenthanhphokhongduocdetrong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            if (txtCWBPosition.Text.Trim().Length == 0)
            {
                txtCWBPosition.Focus();
                MessageBox.Show(UpdateUI.GetString("chuvukhongduocdetrong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            return true;
        }
        private void btnCWBNew_Click(object sender, EventArgs e)
        {
            _CWBInfo.ID = 0;
            mtxCWB_StartDate.Text = "";
            mtxCWB_EndDate.Text = "";
            txtCWBCompanyName.Text = "";
            txtCWBCity.Text = "";
            txtCWBPosition.Text = "";
            mtxCWB_StartDate.Focus();
        }
        private void btnCWBSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (CheckValidCWB())
                {
                    CWBIn();
                    if (_CWBInfo.ID > 0)//update
                    {
                        if (!listRole.Update)
                        {
                            MessageBox.Show(UpdateUI.GetString("khongcoquyencapnhat"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                        if (_wcfCWB.CWB_Exist(_CWBInfo.ID, _CWBInfo.CandidateID, txtCWBCompanyName.Text.Trim()))
                        {
                            MessageBox.Show(UpdateUI.GetString("datontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                        if (_wcfCWB.CWB_Update(_CWBInfo))
                        {
                            Program.taskbarNotifier.Show(UpdateUI.GetString("thongbao"), UpdateUI.GetString("capnhatthanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                            LoadData_CWB();
                        }
                        else
                            MessageBox.Show(UpdateUI.GetString("capnhatkhongthanhcong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        if (!listRole.Create)
                        {
                            MessageBox.Show(UpdateUI.GetString("khongcoquyenthemmoi"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                        if (_wcfCWB.CWB_Exist(_CWBInfo.ID, _CWBInfo.CandidateID, txtCWBCompanyName.Text.Trim()))
                        {
                            MessageBox.Show(UpdateUI.GetString("datontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                        _CWBInfo.ID = _wcfCWB.CWB_Insert(_CWBInfo);
                        if (_CWBInfo.ID > 0)
                        {
                            Program.taskbarNotifier.Show(UpdateUI.GetString("thongbao"), UpdateUI.GetString("themmoithanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                            LoadData_CWB();
                        }
                        else
                            MessageBox.Show(UpdateUI.GetString("themmoikhongthanhcong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    dgvCWB_CellClick(null, null);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(UpdateUI.GetString("loi") + ":\n" + ex.Message + "\n" + UpdateUI.GetString("ghiloi"));
            }
        }
        private void dgvCWB1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!listRole.Delete)
            {
                MessageBox.Show(UpdateUI.GetString("khongcoquyenxoa"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (e.RowIndex < 0 || e.ColumnIndex !=
                    dgvCWB.Columns["CWB_Command"].Index) return;
            int CWBID = Convert.ToInt32(dgvCWB.CurrentRow.Cells["CWB_ID"].Value);
            if (MessageBox.Show(UpdateUI.GetString("bancochacchanxoa"), UIParamater.TitleProject, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                if (_wcfCWB.CWB_Delete(CWBID))
                {
                    Program.taskbarNotifier.Show(UIParamater.TitleProject, UpdateUI.GetString("xoathanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                    LoadData_CWB();
                }
                else
                {
                    MessageBox.Show(UpdateUI.GetString("xoakhongthanhcong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            dgvCWB_CellClick(null, null);
        }
        private void dgvCWB_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dgvCWB.SelectedRows.Count > 0)
            {
                int CWBID = Convert.ToInt32(dgvCWB.CurrentRow.Cells["CWB_ID"].Value);
                _CWBInfo.ID = CWBID;
                ReadFromdgvCWB();
                CWBOut();
            }
        }
        private void ReadFromdgvCWB()
        {

            _CWBInfo.CompanyName = dgvCWB.CurrentRow.Cells["CWB_CompanyName"].Value.ToString();
            _CWBInfo.Position = dgvCWB.CurrentRow.Cells["CWB_Position"].Value.ToString();
            _CWBInfo.StartDate = dgvCWB.CurrentRow.Cells["CWB_StartDate"].Value == DBNull.Value ? DateTime.MinValue :
               Convert.ToDateTime(dgvCWB.CurrentRow.Cells["CWB_StartDate"].Value);
            _CWBInfo.EndDate = dgvCWB.CurrentRow.Cells["CWB_EndDate"].Value == DBNull.Value ? DateTime.MinValue :
                Convert.ToDateTime(dgvCWB.CurrentRow.Cells["CWB_EndDate"].Value);
            _CWBInfo.City = dgvCWB.CurrentRow.Cells["CWB_City"].Value.ToString();
        }
        private void dgvCWB_SelectionChanged(object sender, EventArgs e)
        {
            if (dgvCWB.SelectedRows.Count > 0)
            {
                int CWBID = Convert.ToInt32(dgvCWB.CurrentRow.Cells["CWB_ID"].Value);
                if (CWBID > 0)
                {
                    _CWBInfo.ID = CWBID;
                    ReadFromdgvCWB();
                }
            }
            else
            {
                _CWBInfo.ID = 0;
                _CWBInfo.CompanyName = "";
                _CWBInfo.Position = "";
                _CWBInfo.StartDate = DateTime.MinValue;
                _CWBInfo.EndDate = DateTime.MinValue;
                _CWBInfo.City = "";
            }
            CWBOut();
        }
        private void CWBIn()
        {
            _CWBInfo.CandidateID = _CandidateInfo.ID;
            _CWBInfo.CompanyName = txtCWBCompanyName.Text;
            _CWBInfo.Position = txtCWBPosition.Text;
            _CWBInfo.StartDate = UISetting.GetDate(mtxCWB_StartDate.Text);
            _CWBInfo.EndDate = UISetting.GetDate(mtxCWB_EndDate.Text);
            _CWBInfo.City = txtCWBCity.Text;
        }
        private void CWBOut()
        {
            txtCWBCompanyName.Text = _CWBInfo.CompanyName;
            txtCWBPosition.Text = _CWBInfo.Position;
            mtxCWB_StartDate.Text = _CWBInfo.StartDate == DateTime.MinValue ? "" : Convert.ToDateTime(_CWBInfo.StartDate).ToString("dd/MM/yyyy");
            mtxCWB_EndDate.Text = _CWBInfo.EndDate == DateTime.MinValue ? "" : Convert.ToDateTime(_CWBInfo.EndDate).ToString("dd/MM/yyyy");
            txtCWBCity.Text = _CWBInfo.City;
        }

        #endregion

        #region CFamily (Family)

        int itemCount_CFamily = 0;
        int currPage_CFamily = 0;
        private void LoadData_CFamily()
        {
            try
            {
                DataSet _ds = _wcfCFamily.CFamily_GetList(out itemCount_CFamily, _CandidateInfo.ID, currPage_CFamily, pageSize);
                dgvCFamily.Rows.Clear();
                for (int i = 0; i < _ds.Tables[0].Rows.Count; i++)
                {
                    dgvCFamily.Rows.Insert(i, 1);
                    dgvCFamily.Rows[i].Cells["CFamily_ID"].Value = _ds.Tables[0].Rows[i]["CFamily_ID"].ToString();
                    dgvCFamily.Rows[i].Cells["CFamily_RowNumber"].Value = _ds.Tables[0].Rows[i]["RowNumber"].ToString();
                    dgvCFamily.Rows[i].Cells["CFamily_Name"].Value = _ds.Tables[0].Rows[i]["CFamily_Name"].ToString();
                    if (_ds.Tables[0].Rows[i]["CFamily_DOB"] != DBNull.Value)
                        dgvCFamily.Rows[i].Cells["CFamily_DOB"].Value = Convert.ToDateTime(_ds.Tables[0].Rows[i]["CFamily_DOB"]).ToString("dd/MM/yyyy");
                    else
                        dgvCFamily.Rows[i].Cells["CFamily_DOB"].Value = DateTime.MinValue;
                    dgvCFamily.Rows[i].Cells["CFamily_Relationship"].Value = _ds.Tables[0].Rows[i]["CFamily_Relationship"].ToString();
                    dgvCFamily.Rows[i].Cells["CFamily_Age"].Value = _ds.Tables[0].Rows[i]["CFamily_Age"].ToString();
                    dgvCFamily.Rows[i].Cells["CFamily_Employment"].Value = _ds.Tables[0].Rows[i]["CFamily_Employment"].ToString();



                    dgvCFamily.Rows[i].Cells["CFamily_Address"].Value = _ds.Tables[0].Rows[i]["CFamily_Address"].ToString();

                    if (_ds.Tables[0].Rows[i]["CFamily_IsDependent"] != DBNull.Value)
                        dgvCFamily.Rows[i].Cells["CFamily_IsDependent"].Value = Convert.ToBoolean(_ds.Tables[0].Rows[i]["CFamily_IsDependent"]);
                    else
                        dgvCFamily.Rows[i].Cells["CFamily_IsDependent"].Value = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(UpdateUI.GetString("loi") + ":\n" + ex.Message + "\n" + UpdateUI.GetString("ghiloi"));
            }
        }
        private bool CheckValidCFamily()
        {
            if (_CandidateInfo.ID == 0)
            {
                MessageBox.Show(UpdateUI.GetString("chualuuthongtincanhan"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            if (txtCFamily_Name.Text.Trim().Length == 0)
            {
                txtCFamily_Name.Focus();
                MessageBox.Show(UpdateUI.GetString("tenkhongduocdetrong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            if (UISetting.GetIntNo(txtCFamily_Age.Text) == 0)
            {
                txtCFamily_Age.Focus();
                MessageBox.Show(UpdateUI.GetString("tuoikhonghople"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            return true;
        }
        private void btnCFamilyNew_Click(object sender, EventArgs e)
        {
            _CFamilyInfo.ID = 0;
            txtCFamily_Name.Text = "";
            mtxCFamily_DOB.Text = "";
            txtCFamily_Relationship.Text = "";
            txtCFamily_Age.Text = "";
            txtCFamily_Employment.Text = "";
            txtCFamily_Address.Text = "";
            rdnCFamily_IsDependentY.Checked = false;
            rdnCFamily_IsDependentN.Checked = false;
            txtCFamily_Name.Focus();
        }
        private void btnCFamilySave_Click(object sender, EventArgs e)
        {
            try
            {
                if (CheckValidCFamily())
                {
                    CFamilyIn();
                    if (_CFamilyInfo.ID > 0)//update
                    {
                        if (!listRole.Update)
                        {
                            MessageBox.Show(UpdateUI.GetString("khongcoquyencapnhat"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                        if (_wcfCFamily.CFamily_Exist(_CFamilyInfo.ID, _CFamilyInfo.CandidateID, txtCFamily_Name.Text.Trim()))
                        {
                            MessageBox.Show(UpdateUI.GetString("datontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                        if (_wcfCFamily.CFamily_Update(_CFamilyInfo))
                        {
                            Program.taskbarNotifier.Show(UpdateUI.GetString("thongbao"), UpdateUI.GetString("capnhatthanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                            LoadData_CFamily();
                        }
                        else
                            MessageBox.Show(UpdateUI.GetString("capnhatkhongthanhcong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        if (!listRole.Create)
                        {
                            MessageBox.Show(UpdateUI.GetString("khongcoquyenthemmoi"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                        if (_wcfCFamily.CFamily_Exist(_CFamilyInfo.ID, _CFamilyInfo.CandidateID, txtCFamily_Name.Text.Trim()))
                        {
                            MessageBox.Show(UpdateUI.GetString("datontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                        _CFamilyInfo.ID = _wcfCFamily.CFamily_Insert(_CFamilyInfo);
                        if (_CFamilyInfo.ID > 0)
                        {
                            Program.taskbarNotifier.Show(UpdateUI.GetString("thongbao"), UpdateUI.GetString("themmoithanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                            LoadData_CFamily();
                        }
                        else
                            MessageBox.Show(UpdateUI.GetString("themmoikhongthanhcong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    dgvCFamily_CellClick(null, null);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(UpdateUI.GetString("loi") + ":\n" + ex.Message + "\n" + UpdateUI.GetString("ghiloi"));
            }
        }
        private void dgvCFamily1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!listRole.Delete)
            {
                MessageBox.Show(UpdateUI.GetString("khongcoquyenxoa"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (e.RowIndex < 0 || e.ColumnIndex !=
                    dgvCFamily.Columns["CFamily_Command"].Index) return;
            int CFamilyID = Convert.ToInt32(dgvCFamily.CurrentRow.Cells["CFamily_ID"].Value);
            if (MessageBox.Show(UpdateUI.GetString("bancochacchanxoa"), UIParamater.TitleProject, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                if (_wcfCFamily.CFamily_Delete(CFamilyID))
                {
                    Program.taskbarNotifier.Show(UIParamater.TitleProject, UpdateUI.GetString("xoathanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                    LoadData_CFamily();
                }
                else
                {
                    MessageBox.Show(UpdateUI.GetString("xoakhongthanhcong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            dgvCFamily_CellClick(null, null);
        }
        private void dgvCFamily_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dgvCFamily.SelectedRows.Count > 0)
            {
                int CFamilyID = Convert.ToInt32(dgvCFamily.CurrentRow.Cells["CFamily_ID"].Value);
                _CFamilyInfo.ID = CFamilyID;
                ReadFromdgvCFamily();
                CFamilyOut();
            }
        }
        private void ReadFromdgvCFamily()
        {

            _CFamilyInfo.Name = dgvCFamily.CurrentRow.Cells["CFamily_Name"].Value.ToString();
            _CFamilyInfo.DOB = Convert.ToDateTime(dgvCFamily.CurrentRow.Cells["CFamily_DOB"].Value);
            _CFamilyInfo.Relationship = dgvCFamily.CurrentRow.Cells["CFamily_Relationship"].Value.ToString();
            _CFamilyInfo.Age = Convert.ToInt32(dgvCFamily.CurrentRow.Cells["CFamily_Age"].Value);
            _CFamilyInfo.Employment = dgvCFamily.CurrentRow.Cells["CFamily_Employment"].Value.ToString();
            _CFamilyInfo.Address = dgvCFamily.CurrentRow.Cells["CFamily_Address"].Value.ToString();
            _CFamilyInfo.IsDependent = Convert.ToBoolean(dgvCFamily.CurrentRow.Cells["CFamily_IsDependent"].Value);

        }
        private void dgvCFamily_SelectionChanged(object sender, EventArgs e)
        {
            if (dgvCFamily.SelectedRows.Count > 0)
            {
                int CFamilyID = Convert.ToInt32(dgvCFamily.CurrentRow.Cells["CFamily_ID"].Value);
                if (CFamilyID > 0)
                {
                    _CFamilyInfo.ID = CFamilyID;
                    ReadFromdgvCFamily();
                }
            }
            else
            {
                _CFamilyInfo.ID = 0;
                _CFamilyInfo.Name = "";
                _CFamilyInfo.DOB = DateTime.MinValue;
                _CFamilyInfo.Relationship = "";
                _CFamilyInfo.Age = 0;
                _CFamilyInfo.Employment = "";
                _CFamilyInfo.Address = "";
                _CFamilyInfo.IsDependent = false;
            }
            CFamilyOut();
        }
        private void CFamilyIn()
        {
            _CFamilyInfo.CandidateID = _CandidateInfo.ID;
            _CFamilyInfo.Name = txtCFamily_Name.Text;
            _CFamilyInfo.DOB = UISetting.GetDate(mtxCFamily_DOB.Text);
            _CFamilyInfo.Relationship = txtCFamily_Relationship.Text;
            _CFamilyInfo.Age = UISetting.GetIntNo(txtCFamily_Age.Text);
            _CFamilyInfo.Employment = txtCFamily_Employment.Text;
            _CFamilyInfo.Address = txtCFamily_Address.Text;
            _CFamilyInfo.IsDependent = rdnCFamily_IsDependentY.Checked;
        }
        private void CFamilyOut()
        {
            txtCFamily_Name.Text = _CFamilyInfo.Name;
            mtxCFamily_DOB.Text = _CFamilyInfo.DOB == DateTime.MinValue ? "" : Convert.ToDateTime(_CFamilyInfo.DOB).ToString("dd/MM/yyyy");
            txtCFamily_Relationship.Text = _CFamilyInfo.Relationship;
            txtCFamily_Age.Text = _CFamilyInfo.Age.ToString();
            txtCFamily_Employment.Text = _CFamilyInfo.Employment;
            txtCFamily_Address.Text = _CFamilyInfo.Address;
            rdnCFamily_IsDependentY.Checked = _CFamilyInfo.IsDependent;
            rdnCFamily_IsDependentN.Checked = !rdnCFamily_IsDependentY.Checked;
        }
        private void mtxCFamily_DOB_Leave(object sender, EventArgs e)
        {
            if (UISetting.GetDate(mtxCFamily_DOB.Text) != DateTime.MinValue)
            {
                txtCFamily_Age.ReadOnly = true;
                int _BirthYear = UISetting.GetDate(mtxCFamily_DOB.Text).Year;
                int _NowYear = DateTime.Now.Year;
                txtCFamily_Age.Text = (_NowYear - _BirthYear).ToString();
                txtCFamily_Age.ReadOnly = true;
                txtCFamily_Age.BackColor = tabPage1.BackColor;
            }
            else
            {
                txtCFamily_Age.Text = "0";
                txtCFamily_Age.ReadOnly = false;
                txtCFamily_Age.BackColor = Color.White;
            }
        }
        #endregion

        #region CLanguage (Language)

        int itemCount_CLanguage = 0;
        int currPage_CLanguage = 0;
        private void LoadData_CLanguage()
        {
            try
            {
                DataSet _ds = _wcfCLanguage.CLanguage_GetList(out itemCount_CLanguage, _CandidateInfo.ID, currPage_CLanguage, pageSize);
                dgvCLanguage.Rows.Clear();
                for (int i = 0; i < _ds.Tables[0].Rows.Count; i++)
                {
                    dgvCLanguage.Rows.Insert(i, 1);
                    dgvCLanguage.Rows[i].Cells["CLanguage_ID"].Value = _ds.Tables[0].Rows[i]["CLanguage_ID"].ToString();
                    dgvCLanguage.Rows[i].Cells["CLanguage_RowNumber"].Value = _ds.Tables[0].Rows[i]["RowNumber"].ToString();
                    dgvCLanguage.Rows[i].Cells["CLanguage_Name"].Value = _ds.Tables[0].Rows[i]["CLanguage_Name"].ToString();
                    dgvCLanguage.Rows[i].Cells["Clanguage_SelfRating"].Value = _ds.Tables[0].Rows[i]["Clanguage_SelfRating"].ToString();
                    dgvCLanguage.Rows[i].Cells["Clanguage_CommentsOfInterview"].Value = _ds.Tables[0].Rows[i]["Clanguage_CommentsOfInterview"].ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(UpdateUI.GetString("loi") + ":\n" + ex.Message + "\n" + UpdateUI.GetString("ghiloi"));
            }
        }
        private bool CheckValidCLanguage()
        {
            if (_CandidateInfo.ID == 0)
            {
                MessageBox.Show(UpdateUI.GetString("chualuuthongtincanhan"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            if (txtCLanguage_Name.Text.Trim().Length == 0)
            {
                txtCLanguage_Name.Focus();
                MessageBox.Show(UpdateUI.GetString("ngonngukhongduocdetrong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }
            return true;
        }
        private void btnCLanguageNew_Click(object sender, EventArgs e)
        {
            _CLanguageInfo.ID = 0;
            txtCLanguage_Name.Text = "";
            mcbCLanguage_SelfRating.SelectedValue = "";
            mcbCLanguage_CommentsOfInterview.SelectedValue = "";
            txtCLanguage_Name.Focus();
        }
        private void btnCLanguageSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (CheckValidCLanguage())
                {
                    CLanguageIn();
                    if (_CLanguageInfo.ID > 0)//update
                    {
                        if (!listRole.Update)
                        {
                            MessageBox.Show(UpdateUI.GetString("khongcoquyencapnhat"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                        if (_wcfCLanguage.CLanguage_Exist(_CLanguageInfo.ID, _CLanguageInfo.CandidateID, txtCLanguage_Name.Text.Trim()))
                        {
                            MessageBox.Show(UpdateUI.GetString("datontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                        if (_wcfCLanguage.CLanguage_Update(_CLanguageInfo))
                        {
                            Program.taskbarNotifier.Show(UpdateUI.GetString("thongbao"), UpdateUI.GetString("capnhatthanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                            LoadData_CLanguage();
                        }
                        else
                            MessageBox.Show(UpdateUI.GetString("capnhatkhongthanhcong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        if (!listRole.Create)
                        {
                            MessageBox.Show(UpdateUI.GetString("khongcoquyenthemmoi"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                        if (_wcfCLanguage.CLanguage_Exist(_CLanguageInfo.ID, _CLanguageInfo.CandidateID, txtCLanguage_Name.Text.Trim()))
                        {
                            MessageBox.Show(UpdateUI.GetString("datontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                        _CLanguageInfo.ID = _wcfCLanguage.CLanguage_Insert(_CLanguageInfo);
                        if (_CLanguageInfo.ID > 0)
                        {
                            Program.taskbarNotifier.Show(UpdateUI.GetString("thongbao"), UpdateUI.GetString("themmoithanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                            LoadData_CLanguage();
                        }
                        else
                            MessageBox.Show(UpdateUI.GetString("themmoikhongthanhcong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    dgvCLanguage_CellClick(null, null);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(UpdateUI.GetString("loi") + ":\n" + ex.Message + "\n" + UpdateUI.GetString("ghiloi"));
            }
        }
        private void dgvCLanguage1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!listRole.Delete)
            {
                MessageBox.Show(UpdateUI.GetString("khongcoquyenxoa"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (e.RowIndex < 0 || e.ColumnIndex !=
                    dgvCLanguage.Columns["CLanguage_Command"].Index) return;
            int CLanguageID = Convert.ToInt32(dgvCLanguage.CurrentRow.Cells["CLanguage_ID"].Value);
            if (MessageBox.Show(UpdateUI.GetString("bancochacchanxoa"), UIParamater.TitleProject, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                if (_wcfCLanguage.CLanguage_Delete(CLanguageID))
                {
                    Program.taskbarNotifier.Show(UIParamater.TitleProject, UpdateUI.GetString("xoathanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                    LoadData_CLanguage();
                }
                else
                {
                    MessageBox.Show(UpdateUI.GetString("xoakhongthanhcong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            dgvCLanguage_CellClick(null, null);
        }
        private void dgvCLanguage_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dgvCLanguage.SelectedRows.Count > 0)
            {
                int CLanguageID = Convert.ToInt32(dgvCLanguage.CurrentRow.Cells["CLanguage_ID"].Value);
                _CLanguageInfo.ID = CLanguageID;
                ReadFromdgvCLanguage();
                CLanguageOut();
            }
        }
        private void ReadFromdgvCLanguage()
        {
            _CLanguageInfo.Name = dgvCLanguage.CurrentRow.Cells["CLanguage_Name"].Value.ToString();
            _CLanguageInfo.SelfRating = dgvCLanguage.CurrentRow.Cells["Clanguage_SelfRating"].Value.ToString();
            _CLanguageInfo.CommentsOfInterview = dgvCLanguage.CurrentRow.Cells["Clanguage_CommentsOfInterview"].Value.ToString();
        }
        private void dgvCLanguage_SelectionChanged(object sender, EventArgs e)
        {
            if (dgvCLanguage.SelectedRows.Count > 0)
            {
                int CLanguageID = Convert.ToInt32(dgvCLanguage.CurrentRow.Cells["CLanguage_ID"].Value);
                if (CLanguageID > 0)
                {
                    _CLanguageInfo.ID = CLanguageID;
                    ReadFromdgvCLanguage();
                }
            }
            else
            {
                _CLanguageInfo.ID = 0;
                _CLanguageInfo.Name = "";
                _CLanguageInfo.SelfRating = "";
                _CLanguageInfo.CommentsOfInterview = "";
            }
            CLanguageOut();
        }
        private void CLanguageIn()
        {
            _CLanguageInfo.CandidateID = _CandidateInfo.ID;
            _CLanguageInfo.Name = txtCLanguage_Name.Text;
            _CLanguageInfo.SelfRating = mcbCLanguage_SelfRating.SelectedValue.ToString();
            _CLanguageInfo.CommentsOfInterview = mcbCLanguage_CommentsOfInterview.SelectedValue.ToString();
        }
        private void CLanguageOut()
        {
            txtCLanguage_Name.Text = _CLanguageInfo.Name;
            mcbCLanguage_SelfRating.SelectedValue = _CLanguageInfo.SelfRating;
            mcbCLanguage_CommentsOfInterview.SelectedValue = _CLanguageInfo.CommentsOfInterview;
        }
        #endregion

        #region Overall1
        void Overall1In()
        {
            _CInterviewInfo.CandidateID = _CandidateInfo.ID;
            _CInterviewInfo.Date = UISetting.GetDate(mtxCInterview1_Date.Text);
            _CInterviewInfo.DepartmentOffer = 0;
            _CInterviewInfo.Interviewer = txtCInterview1_Interviewer.Text;
            _CInterviewInfo.InterviewerPosition = Convert.ToInt32(cboCInterview1_Position.SelectedValue);
            _CInterviewInfo.Ordinal = 1;
            _CInterviewInfo.OverallComments = txtCInterview1_OverallComments.Text;
            _CInterviewInfo.PositionOffer = Convert.ToInt32(cboPositionCandidate.SelectedValue);
            _CInterviewInfo.Status = Convert.ToInt32(cboDuyet1.SelectedValue);
            _CInterviewInfo.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
            _CInterviewInfo.Represent = txtRepresent.Text;

        }
        void Overall1Out()
        {
            mtxCInterview1_Date.Text = _CInterviewInfo.Date == DateTime.MinValue ? "" : Convert.ToDateTime(_CInterviewInfo.Date).ToString("dd/MM/yyyy");
            txtCInterview1_Interviewer.Text = _CInterviewInfo.Interviewer;
            cboCInterview1_Position.SelectedValue = _CInterviewInfo.InterviewerPosition;
            cboPositionCandidate.SelectedValue = _CInterviewInfo.PositionOffer;
            txtCInterview1_OverallComments.Text = _CInterviewInfo.OverallComments;
            cboDuyet1.SelectedValue = _CInterviewInfo.Status;
            txtRepresent.Text = _CInterviewInfo.Represent;
        }
        private void CInterview1_Save()
        {
            try
            {
                Overall1In();
                if (_InterviewID1 > 0)//update
                {
                    _CInterviewInfo.ID = _InterviewID1;
                    if (!listRole.Update)
                    {
                        MessageBox.Show(UpdateUI.GetString("khongcoquyencapnhat"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                    if (_wcfCInterview.CInterview_Update(_CInterviewInfo))
                    {
                        Program.taskbarNotifier.Show(UpdateUI.GetString("thongbao"), UpdateUI.GetString("capnhatthanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                    }
                    else
                        MessageBox.Show(UpdateUI.GetString("capnhatkhongthanhcong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    if (!listRole.Create)
                    {
                        MessageBox.Show(UpdateUI.GetString("khongcoquyenthemmoi"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                    _CInterviewInfo.ID = _wcfCInterview.CInterview_Insert(_CInterviewInfo);
                    if (_CInterviewInfo.ID > 0)
                    {
                        _InterviewID1 = _CInterviewInfo.ID;
                        Program.taskbarNotifier.Show(UpdateUI.GetString("thongbao"), UpdateUI.GetString("themmoithanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                    }
                    else
                        MessageBox.Show(UpdateUI.GetString("themmoikhongthanhcong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(UpdateUI.GetString("loi") + ":\n" + ex.Message + "\n" + UpdateUI.GetString("ghiloi"));
            }
        }
        #endregion

        #region Overall2
        void Overall2In()
        {
            _CInterviewInfo.CandidateID = _CandidateInfo.ID;
            _CInterviewInfo.Date = UISetting.GetDate(mtxCInterview2_Date.Text);
            _CInterviewInfo.DepartmentOffer = Convert.ToInt32(cboCInterview2_DepartmentOffer.SelectedValue);
            _CInterviewInfo.Interviewer = txtCInterview2_Interviewer.Text;
            _CInterviewInfo.InterviewerPosition = Convert.ToInt32(cboCInterview2_Position.SelectedValue);
            _CInterviewInfo.Ordinal = 2;
            _CInterviewInfo.OverallComments = txtCInterview2_OverallComments.Text;
            _CInterviewInfo.PositionOffer = Convert.ToInt32(cboCInterview2_PositionOffer.SelectedValue); ;
            _CInterviewInfo.Status = Convert.ToInt32(cboDuyet2.SelectedValue);
            _CInterviewInfo.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);

        }
        void Overall2Out()
        {
            mtxCInterview2_Date.Text = _CInterviewInfo.Date == DateTime.MinValue ? "" : Convert.ToDateTime(_CInterviewInfo.Date).ToString("dd/MM/yyyy");
            txtCInterview2_Interviewer.Text = _CInterviewInfo.Interviewer;
            cboCInterview2_DepartmentOffer.SelectedValue = _CInterviewInfo.DepartmentOffer;
            cboCInterview2_Position.SelectedValue = _CInterviewInfo.InterviewerPosition;
            txtCInterview2_OverallComments.Text = _CInterviewInfo.OverallComments;
            cboCInterview2_PositionOffer.SelectedValue = _CInterviewInfo.PositionOffer;
            cboDuyet2.SelectedValue = _CInterviewInfo.Status;
        }
        void CInterview2_Save()
        {
            try
            {
                Overall2In();
                if (_InterviewID2 > 0)//update
                {
                    _CInterviewInfo.ID = _InterviewID2;
                    if (!listRole.Update)
                    {
                        MessageBox.Show(UpdateUI.GetString("khongcoquyencapnhat"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                    if (_wcfCInterview.CInterview_Update(_CInterviewInfo))
                    {
                        Program.taskbarNotifier.Show(UpdateUI.GetString("thongbao"), UpdateUI.GetString("capnhatthanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                    }
                    else
                        MessageBox.Show(UpdateUI.GetString("capnhatkhongthanhcong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    if (!listRole.Create)
                    {
                        MessageBox.Show(UpdateUI.GetString("khongcoquyenthemmoi"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                    _CInterviewInfo.ID = _wcfCInterview.CInterview_Insert(_CInterviewInfo);
                    if (_CInterviewInfo.ID > 0)
                    {
                        _InterviewID2 = _CInterviewInfo.ID;
                        Program.taskbarNotifier.Show(UpdateUI.GetString("thongbao"), UpdateUI.GetString("themmoithanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                    }
                    else
                        MessageBox.Show(UpdateUI.GetString("themmoikhongthanhcong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(UpdateUI.GetString("loi") + ":\n" + ex.Message + "\n" + UpdateUI.GetString("ghiloi"));
            }
        }
        #endregion

        #region Overall3
        void Overall3In()
        {
            _CInterviewInfo.CandidateID = _CandidateInfo.ID;
            _CInterviewInfo.Date = UISetting.GetDate(mtxCInterview3_Date.Text);
            _CInterviewInfo.DepartmentOffer = 0;
            _CInterviewInfo.Interviewer = txtCInterview3_Interviewer.Text;
            _CInterviewInfo.InterviewerPosition = Convert.ToInt32(cboCInterview3_Position.SelectedValue);
            _CInterviewInfo.Ordinal = 3;
            _CInterviewInfo.OverallComments = txtCInterview3_OverallComments.Text;
            _CInterviewInfo.PositionOffer = 0;
            _CInterviewInfo.Status = Convert.ToInt32(cboDuyet3.SelectedValue);
            _CInterviewInfo.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
        }
        void Overall3Out()
        {
            mtxCInterview3_Date.Text = _CInterviewInfo.Date == DateTime.MinValue ? "" : Convert.ToDateTime(_CInterviewInfo.Date).ToString("dd/MM/yyyy");
            txtCInterview3_Interviewer.Text = _CInterviewInfo.Interviewer;
            cboCInterview3_Position.SelectedValue = _CInterviewInfo.InterviewerPosition;
            txtCInterview3_OverallComments.Text = _CInterviewInfo.OverallComments;
            cboDuyet3.SelectedValue = _CInterviewInfo.Status;
        }
        void CInterview3_Save()
        {
            try
            {
                Overall3In();
                if (_InterviewID3 > 0)//update
                {
                    _CInterviewInfo.ID = _InterviewID3;
                    if (!listRole.Update)
                    {
                        MessageBox.Show(UpdateUI.GetString("khongcoquyencapnhat"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                    if (_wcfCInterview.CInterview_Update(_CInterviewInfo))
                    {
                        Program.taskbarNotifier.Show(UpdateUI.GetString("thongbao"), UpdateUI.GetString("capnhatthanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                    }
                    else
                        MessageBox.Show(UpdateUI.GetString("capnhatkhongthanhcong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    if (!listRole.Create)
                    {
                        MessageBox.Show(UpdateUI.GetString("khongcoquyenthemmoi"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                    _CInterviewInfo.ID = _wcfCInterview.CInterview_Insert(_CInterviewInfo);
                    _InterviewID3 = _CInterviewInfo.ID;
                    if (_CInterviewInfo.ID > 0)
                    {
                        Program.taskbarNotifier.Show(UpdateUI.GetString("thongbao"), UpdateUI.GetString("themmoithanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                    }
                    else
                        MessageBox.Show(UpdateUI.GetString("themmoikhongthanhcong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(UpdateUI.GetString("loi") + ":\n" + ex.Message + "\n" + UpdateUI.GetString("ghiloi"));
            }
        }
        #endregion

        #region Form's Event
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (CheckValidPersonal())
                {
                    CRIn();
                    PersonalIn();
                    if (_CRInfo.ID > 0)//Cập nhật ứng viên trong 1 đợt tuyển dụng
                    {
                        if (_CRInfo.CandidateID > 0)//Cập nhật thông tin ứng viên
                        {
                            //1. Kiểm tra xem đã tồn tại mã ứng viên (nếu sửa )này chưa
                            if (_wcfCandidate.Candidate_Exist(_CandidateInfo.ID, txtCode.Text.Trim()))
                            {
                                MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                return;
                            }
                            CCriteria_Save();
                            CInterview1_Save();
                            //CInterview2_Save();
                            //CInterview3_Save();
                            //2. Cập nhật lại thông tin ứng viên
                            if (_wcfCandidate.Candidate_Update(_CandidateInfo))
                            {
                                //1. Kiểm tra xem đã tồn tại ứng viên này trong đợt tuyển dụng này chưa
                                int _recruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                                if (_wcfCR.CR_Exist(_CRInfo.ID, Convert.ToInt32(txtCode.Tag), _recruitmentID))
                                {

                                    Program.taskbarNotifier.Show(UIParamater.TitleProject, UpdateUI.GetString("datontaiungviennaytrong") + cboRecruitment.Text
                                        , UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                                    return;
                                }
                                //2. Cập nhật thông tin ứng viên này trong đợt tuyển dụng
                                if (_wcfCR.CR_Update(_CRInfo))
                                {
                                    Program.taskbarNotifier.Show(UpdateUI.GetString("thongbao"), UpdateUI.GetString("capnhatthanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                                    dlgResult = DialogResult.OK;
                                    //this.Close();
                                }
                                else
                                    MessageBox.Show(UpdateUI.GetString("capnhatkhongthanhcong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            }
                            else
                                MessageBox.Show(UpdateUI.GetString("capnhatkhongthanhcong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }

                    }
                    else
                    {
                        if (_CRInfo.CandidateID > 0)//Cập nhật thông tin ứng viên
                        {
                            //1. Kiểm tra xem đã tồn tại mã ứng viên (nếu sửa )này chưa
                            if (_wcfCandidate.Candidate_Exist(_CandidateInfo.ID, txtCode.Text.Trim()))
                            {
                                MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                return;
                            }
                            CCriteria_Save();
                            CInterview1_Save();
                            //CInterview2_Save();
                            //CInterview3_Save();
                            //2. Cập nhật lại thông tin ứng viên
                            if (_wcfCandidate.Candidate_Update(_CandidateInfo))
                            {
                                //1. Kiểm tra xem đã tồn tại ứng viên này trong đợt tuyển dụng này chưa
                                int _recruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                                if (_wcfCR.CR_Exist(_CRInfo.ID, Convert.ToInt32(txtCode.Tag), _recruitmentID))
                                {

                                    Program.taskbarNotifier.Show(UIParamater.TitleProject, UpdateUI.GetString("datontaiungviennaytrong") + cboRecruitment.Text
                                        , UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                                    return;
                                }
                                //2. Cập nhật đưa ứng viên này vào đợt tuyển dụng
                                _CRInfo.CandidateID = _CandidateInfo.ID;
                                _CRInfo.ID = _wcfCR.CR_Insert(_CRInfo);
                                if (_CRInfo.ID > 0)
                                {
                                    Program.taskbarNotifier.Show(UpdateUI.GetString("thongbao"), UpdateUI.GetString("themmoithanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                                    dlgResult = DialogResult.OK;
                                    //this.Close();
                                }
                                else
                                    MessageBox.Show(UpdateUI.GetString("themmoikhongthanhcong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);

                            }
                            else
                                MessageBox.Show(UpdateUI.GetString("capnhatkhongthanhcong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                        else
                        {
                            //1. Kiểm tra xem đã tồn tại mã ứng viên này chưa
                            if (_wcfCandidate.Candidate_Exist(_CRInfo.CandidateID, txtCode.Text.Trim()))
                            {
                                MessageBox.Show(UpdateUI.GetString("datontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                return;
                            }
                            //2. Thêm mới thông tin ứng viên
                            _CandidateInfo.ID = _wcfCandidate.Candidate_Insert(_CandidateInfo);
                            if (_CandidateInfo.ID > 0)
                            {
                                if (_wcfCInterview.CInterview_GetInfo(_CandidateInfo.ID, _CRInfo.RecruitmentID, 1) != null)
                                {
                                    _CInterviewInfo = _wcfCInterview.CInterview_GetInfo(_CandidateInfo.ID, _CRInfo.RecruitmentID, 1);
                                    _InterviewID1 = _CInterviewInfo.ID;
                                }

                                if (_wcfCInterview.CInterview_GetInfo(_CandidateInfo.ID, _CRInfo.RecruitmentID, 2) != null)
                                {
                                    _CInterviewInfo = _wcfCInterview.CInterview_GetInfo(_CandidateInfo.ID, _CRInfo.RecruitmentID, 2);
                                    _InterviewID2 = _CInterviewInfo.ID;
                                }

                                if (_wcfCInterview.CInterview_GetInfo(_CandidateInfo.ID, _CRInfo.RecruitmentID, 3) != null)
                                {
                                    _CInterviewInfo = _wcfCInterview.CInterview_GetInfo(_CandidateInfo.ID, _CRInfo.RecruitmentID, 3);
                                    _InterviewID3 = _CInterviewInfo.ID;
                                }

                                // Cập nhật đưa ứng viên này vào đợt tuyển dụng
                                _CRInfo.CandidateID = _CandidateInfo.ID;
                                _CRInfo.ID = _wcfCR.CR_Insert(_CRInfo);
                                if (_CRInfo.ID > 0)
                                {
                                    Program.taskbarNotifier.Show(UpdateUI.GetString("thongbao"), UpdateUI.GetString("themmoithanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);
                                    dlgResult = DialogResult.OK;
                                    //this.Close();
                                }
                                else
                                    MessageBox.Show(UpdateUI.GetString("themmoikhongthanhcong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);

                            }
                            else
                                MessageBox.Show(UpdateUI.GetString("themmoikhongthanhcong"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }

                    }


                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(UpdateUI.GetString("loi") + ":\n" + ex.Message + "\n" + UpdateUI.GetString("ghiloi"));
            }
        }
        private void btnOk_Click(object sender, EventArgs e)
        {
            try
            {
                RoleRightInfo _listRole = UIParamater.Quyen_HoSoCanBo;
                if (_CRInfo.ID > 0)
                {
                    if (!listRole.Update)
                    {
                        MessageBox.Show(UpdateUI.GetString("khongcoquyenthemmoi"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                    if (_CRInfo.Status != 6)
                    {
                        MessageBox.Show(UpdateUI.GetString("nguoinaychuadatphongvanlan3khongduocchuyen"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                    if (CheckValidPersonal())
                    {

                        CRIn();
                        PersonalIn();
                        if (_CRInfo.CandidateID > 0)//update
                        {
                            _wcfCandidate.Candidate_Update(_CandidateInfo);
                            _CRInfo.Status = 8;
                            //Cập nhật trạng thái cho hồ sơ Candidate_Status = 8 (Trúng tuyển)
                            if (_wcfCR.CR_CandidateMatriculate(_CRInfo.ID, _CRInfo.CandidateID, _CRInfo.Status))
                            {
                                //Đọc dữ liệu ứng viên (candiate) từ form và gán cho nhân viên (Employee)
                                EmployeeIn();
                                //Lưu thông tin nhân viên
                                _EmployeeInfo.ID = _wcfEmployee.Employee_Insert(_EmployeeInfo);
                                if (_EmployeeInfo.ID > 0)
                                {
                                    //Đọc thông tin chi tiết về chức vụ đề xuất của ứng viên rồi chuyển thành chức vụ thực tế cho nhân viên
                                    PositionDetailIn();

                                    // Lưu thông tin chức vụ cho nhân viên
                                    _PositionDetailInfo.ID = _wcfPositionDetail.PositionDetail_Insert(_PositionDetailInfo);
                                    if (_PositionDetailInfo.ID > 0)
                                    {
                                        //1. Kinh nghiệm làm việc
                                        //WorkingBackgroundClient wcfWork = Service.WorkingBackground();
                                        WorkingBackground_Controller wcfWork = WorkingBackground_Controller.Instance();
                                        WorkingBackgroundInfo[] tracksWork = ReadWB();

                                        if (tracksWork.Length > 0)
                                        {
                                            for (int i = 0; i < tracksWork.Length; i++)
                                            {
                                                if (wcfWork.WorkingBackground_Insert(tracksWork[i]) == -1)
                                                {
                                                    MessageBox.Show(UpdateUI.GetString("capnhatkhongthanhcong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                                    break;
                                                }
                                            }
                                        }
                                        //2. Quan hệ gia đình
                                        FamilyClient wcfFamily = Service.Family();
                                        FamilyInfo[] tracksFamily = ReadFamily();

                                        if (tracksFamily.Length > 0)
                                        {
                                            for (int i = 0; i < tracksFamily.Length; i++)
                                            {
                                                if (wcfFamily.Family_Insert(tracksFamily[i]) == -1)
                                                {
                                                    MessageBox.Show(UpdateUI.GetString("capnhatkhongthanhcong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                                    break;
                                                }
                                            }
                                        }
                                        //3. Chứng chỉ
                                        CertificateClient wcfCertificate = Service.Certificate();
                                        CertificateInfo[] tracksCertificate = ReadCertificate();

                                        if (tracksCertificate.Length > 0)
                                        {
                                            for (int i = 0; i < tracksCertificate.Length; i++)
                                            {
                                                if (wcfCertificate.Certificate_Insert(tracksCertificate[i]) == -1)
                                                {
                                                    MessageBox.Show(UpdateUI.GetString("capnhatkhongthanhcong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                                    break;
                                                }
                                            }
                                        }
                                        this.Close();
                                        Form f2 = new frmEmployeeInfo(_EmployeeInfo.ID, 0, 0, UIParamater.Employee_Active, _listRole);
                                        if (f2.ShowDialog(this) == DialogResult.OK)
                                        {
                                            dlgResult = DialogResult.OK;
                                        }
                                    }
                                    else
                                        MessageBox.Show(UpdateUI.GetString("capnhatkhongthanhcong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);

                                }
                                else
                                    MessageBox.Show(UpdateUI.GetString("capnhatkhongthanhcong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);

                                Program.taskbarNotifier.Show(UpdateUI.GetString("thongbao"), UpdateUI.GetString("capnhatthanhcong"), UIParamater.TIME_MOVE_UP, UIParamater.TIME_SHOW, UIParamater.TIME_MOVE_DOWN);



                            }
                            else
                                MessageBox.Show(UpdateUI.GetString("capnhatkhongthanhcong"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                }
                else
                    MessageBox.Show(UpdateUI.GetString("canphailuuthongtincuaungvientruoc"), UpdateUI.GetString("thongbao"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            catch (Exception ex)
            {
                MessageBox.Show(UpdateUI.GetString("loi") + ":\n" + ex.Message + "\n" + UpdateUI.GetString("ghiloi"));
            }
        }

        private void btnNew_Click(object sender, EventArgs e)
        {
            if (!listRole.Create)
            {
                MessageBox.Show(UpdateUI.GetString("khongcoquyenthemmoi"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            _CandidateInfo.ID = 0;
            txtCode.Text = _wcfCandidate.Candidate_AutoCreateCode().No;
            txtFirstName.Text = "";
            txtLastName.Text = "";
            txtAlias.Text = "";
            mtxBirthday.Text = "";
            txtBirthPlace.Text = "";
            txtAddress.Text = "";
            txtPhone.Text = "";
            rdnMale.Checked = false;
            rdnFemale.Checked = false;
            cboMaritalStatus.SelectedIndex = 0;
            cboEthlic.SelectedIndex = 0;
            cboReligion.SelectedIndex = 0;
            txtIDCardNo.Text = "";
            mtxIDCardIssueDate.Text = "";
            txtIDCardIssueAuthority.Text = "";
            mtxDate.Text = "";
            rdnResidentYes.Checked = false;
            rdnResidentNo.Checked = false;
            cboTransport.Text = "";
            txtDescription.Text = "";
            cboLocate.SelectedIndex = 0;
            cboPosition.SelectedIndex = 0;
            mtxWhenAvailable.Text = "";
            txtMinSalaryExpected.Text = "0";
            rdnWorkOnShiftYes.Checked = false;
            rdnWorkOnShiftNo.Checked = false;
            chkSpecialSkill1.Checked = false;
            chkSpecialSkill2.Checked = false;
            chkSpecialSkill3.Checked = false;
            chkSpecialSkill4.Checked = false;
            rdnAcquaintanceY.Checked = false;
            rdnAcquaintanceN.Checked = false;
            txtAcquaintanceName.Text = "";
            rdnPartimeCourseY.Checked = false;
            rdnPartimeCourseN.Checked = false;
            txtCourseName.Text = "";
            txtCourseTime.Text = "0";
            txtFinancialController.Text = "";
            mtxSalaryDate.Text = "";
            mtxProbationStartDate.Text = "";
            txtProbationPeriod.Text = "0";
            txtProbationSalary.Text = "0";
            txtTraningSalary.Text = "0";
            txtConfomationSalary.Text = "0";
            txtOthers.Text = "";

            dgvCC.Rows.Clear();
            dgvCWB.Rows.Clear();
            dgvCFamily.Rows.Clear();
            dgvCLanguage.Rows.Clear();

        }

        void LoadLanguage()
        {
            if (this.Tag != null)
                this.Text = UpdateUI.GetString(this.Tag.ToString());
            UpdateUI.Load_ToolStrip(ref toolStrip1);
            UpdateUI.Load_TabControl(ref tabCandidate);
            UpdateUI.Load_Panel(ref panel1);
            UpdateUI.Load_Panel(ref panel2);
            UpdateUI.Load_Panel(ref panel5);
            UpdateUI.Load_Panel(ref panel6);

        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void frmCR_FormClosing(object sender, FormClosingEventArgs e)
        {
            _wcfCandidate.Close();
            _wcfCC.Close();
            _wcfCCriteria.Close();
            _wcfCFamily.Close();
            _wcfCInterview.Close();
            _wcfCLanguage.Close();
            _wcfCR.Close();
            _wcfCWB.Close();
            _wcfEmployee.Close();
            _wcfPositionDetail.Close();
            _wcfRecruitment.Close();
            this.DialogResult = dlgResult;
        }

        private void frmCR_KeyUp(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
                case Keys.Escape:
                    this.Dispose();
                    this.Close();
                    break;
                case Keys.F2:
                    btnNew_Click(null, null);
                    break;
                case Keys.F3:
                    if (btnSave.Enabled)
                        btnSave_Click(null, null);
                    break;
                case Keys.F4:
                    if (btnOk.Enabled)
                        btnOk_Click(null, null);
                    break;
                case Keys.Enter:
                    if (!e.Alt && !e.Control)
                    {
                        this.ProcessTabKey(!e.Shift);
                        e.Handled = true;
                    }
                    break;
            }
        }

        private void rdnPartimeCourseN_CheckedChanged(object sender, EventArgs e)
        {
            if (rdnPartimeCourseN.Checked)
            {
                txtCourseTime.Text = "";
                txtCourseTime.BackColor = tabPage1.BackColor;
                txtCourseTime.ReadOnly = true;

                txtCourseName.Text = "";
                txtCourseName.BackColor = tabPage1.BackColor;
                txtCourseName.ReadOnly = true;
            }
        }

        private void rdnPartimeCourseY_CheckedChanged(object sender, EventArgs e)
        {
            if (rdnPartimeCourseY.Checked)
            {
                txtCourseTime.Text = "";
                txtCourseTime.BackColor = Color.White;
                txtCourseTime.ReadOnly = false;

                txtCourseName.Text = "";
                txtCourseName.BackColor = Color.White;
                txtCourseName.ReadOnly = false;
            }
        }

        private void rdnAcquaintanceN_CheckedChanged(object sender, EventArgs e)
        {
            if (rdnAcquaintanceN.Checked)
            {
                txtAcquaintanceName.Text = "";
                txtAcquaintanceName.BackColor = tabPage1.BackColor;
                txtAcquaintanceName.ReadOnly = true;
            }
        }

        private void rdnAcquaintanceY_CheckedChanged(object sender, EventArgs e)
        {
            if (rdnAcquaintanceY.Checked)
            {
                txtAcquaintanceName.Text = "";
                txtAcquaintanceName.BackColor = Color.White;
                txtAcquaintanceName.ReadOnly = false;
            }
        }

        private void btnSelectCandidate_Click(object sender, EventArgs e)
        {
            frmCandidateList f = new frmCandidateList(true);
            f.ShowDialog(this);
            if (f.Candidate_ID > 0)
            {

                _CandidateInfo = _wcfCandidate.Candidate_GetInfo(f.Candidate_ID);
                PersonalOut();
                _CandidateInfo.ID = f.Candidate_ID;
                LoadData_CC();
                LoadData_CWB();
                LoadData_CFamily();
                LoadData_CLanguage();
                txtCode.Focus();
            }
            f.Dispose();

        }

        private void cboDuyet1_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (Convert.ToInt32(cboDuyet1.SelectedValue))
            {
                case 0:
                    cboStatus.SelectedValue = 1; // Nhập hồ sơ
                    break;
                case 1:
                    cboStatus.SelectedValue = 2; // Qua pv 1
                    break;
                case 2:
                    cboStatus.SelectedValue = 3; // Trượ pv1
                    break;
            }
        }

        private void cboDuyet2_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (Convert.ToInt32(cboDuyet2.SelectedValue))
            {
                case 0:
                    cboStatus.SelectedValue = 2; // Qua pv 1
                    break;
                case 1:
                    cboStatus.SelectedValue = 4; // Qua pv 2
                    break;
                case 2:
                    cboStatus.SelectedValue = 5; // Trượt pv2
                    break;

            }
        }

        private void cboDuyet3_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (Convert.ToInt32(cboDuyet3.SelectedValue))
            {
                case 0:
                    cboStatus.SelectedValue = 4; // Qua pv 2
                    break;
                case 1:
                    cboStatus.SelectedValue = 6; // Qua pv 3
                    break;
                case 2:
                    cboStatus.SelectedValue = 7; // Trượt pv3

                    break;

            }
        }

        #endregion

        private void EmployeeIn()
        {

            _EmployeeInfo.Code = "NV-" + DateTime.Now.ToString("yyMMddHHmmss");
            _EmployeeInfo.CardNo = "";
            _EmployeeInfo.FirstName = txtFirstName.Text.Trim();
            _EmployeeInfo.LastName = txtLastName.Text.Trim();
            _EmployeeInfo.Alias = txtAlias.Text.Trim();
            _EmployeeInfo.Education = Convert.ToInt32(cboStandard.SelectedValue);
            _EmployeeInfo.DateOfBirth = DateTime.ParseExact(mtxBirthday.Text, "dd/MM/yyyy", null);
            _EmployeeInfo.Sex = rdnMale.Checked;
            _EmployeeInfo.MaterialStatusID = Convert.ToInt32(cboMaritalStatus.SelectedValue);
            _EmployeeInfo.ReligionID = Convert.ToInt32(cboReligion.SelectedValue);
            _EmployeeInfo.EthlicID = Convert.ToInt32(cboEthlic.SelectedValue);
            _EmployeeInfo.PlaceOfBirth = txtBirthPlace.Text;
            _EmployeeInfo.Address = txtAddress.Text;
            _EmployeeInfo.Phone = txtPhone.Text;
            _EmployeeInfo.IDCardNo = txtIDCardNo.Text;
            _EmployeeInfo.IDCardIssueDate = UISetting.GetDate(mtxIDCardIssueDate.Text);
            _EmployeeInfo.IDCardIssueAuthority = txtIDCardIssueAuthority.Text;
            _EmployeeInfo.SIBookNo = "";
            _EmployeeInfo.SIBookIssueDate = DateTime.MinValue;
            _EmployeeInfo.SIBookIssueAuthority = "";
            _EmployeeInfo.BankName = "";
            _EmployeeInfo.BankAccountNo = "";
            _EmployeeInfo.Description = txtDescription.Text;
            _EmployeeInfo.StartDate = UISetting.GetDate(mtxProbationStartDate.Text);
            _EmployeeInfo.EndDate = DateTime.MinValue;
            _EmployeeInfo.PassportNo = "";
            _EmployeeInfo.PassportIssueDate = DateTime.MinValue;
            _EmployeeInfo.PassportExpireDate = DateTime.MinValue;
            _EmployeeInfo.Nationality = 2; //Việt Nam
            _EmployeeInfo.MedicalNo = "";
            _EmployeeInfo.MedicalDate = DateTime.MinValue;
            _EmployeeInfo.MedicalPlace = "";

        }

        private void PositionDetailIn()
        {
            _PositionDetailInfo.BeginDate = UISetting.GetDate(mtxProbationStartDate.Text);
            _PositionDetailInfo.EndDate = DateTime.MinValue;
            _PositionDetailInfo.EmployeeID = _EmployeeInfo.ID;
            _PositionDetailInfo.DepartmentID = Convert.ToInt32(cboLocate.SelectedValue);
            _PositionDetailInfo.PositionID = Convert.ToInt32(cboPosition.SelectedValue);
            _PositionDetailInfo.GradeID = 1;
            _PositionDetailInfo.PositionAllowance = 0;
            _PositionDetailInfo.BasicSalary = 0;
            _PositionDetailInfo.IsActive = true;
            _PositionDetailInfo.Description = "";
        }

        private WorkingBackgroundInfo[] ReadWB()
        {
            if (_CandidateInfo.ID > 0)
            {
                int n = dgvCWB.Rows.Count;
                WorkingBackgroundInfo[] tracks = new WorkingBackgroundInfo[n];
                for (int i = 0; i < n; i++)
                {
                    tracks[i] = new WorkingBackgroundInfo();
                    tracks[i].WB_ID = 0;
                    tracks[i].WB_EmployeeID = _EmployeeInfo.ID;
                    tracks[i].WB_CompanyName = dgvCWB.Rows[i].Cells["CWB_CompanyName"].Value.ToString();
                    tracks[i].WB_Position = dgvCWB.Rows[i].Cells["CWB_Position"].Value.ToString();
                    if (dgvCWB.Rows[i].Cells["CWB_StartDate"].Value.ToString() == "")
                        tracks[i].WB_StartDate = DateTime.MinValue;
                    else
                        tracks[i].WB_StartDate = Convert.ToDateTime(dgvCWB.Rows[i].Cells["CWB_StartDate"].Value);
                    if (dgvCWB.Rows[i].Cells["CWB_EndDate"].Value.ToString() == "")
                        tracks[i].WB_EndDate = DateTime.MinValue;
                    else
                        tracks[i].WB_EndDate = Convert.ToDateTime(dgvCWB.Rows[i].Cells["CWB_EndDate"].Value);
                    tracks[i].WB_Description = dgvCWB.Rows[i].Cells["CWB_City"].Value.ToString();
                }
                return tracks;
            }
            else
            {
                return null;
            }

        }

        private FamilyInfo[] ReadFamily()
        {

            if (_CandidateInfo.ID > 0)
            {
                int n = dgvCFamily.Rows.Count;
                FamilyInfo[] tracks = new FamilyInfo[n];
                for (int i = 0; i < n; i++)
                {
                    tracks[i] = new FamilyInfo();
                    tracks[i].ID = 0;
                    tracks[i].EmployeeID = _EmployeeInfo.ID;
                    tracks[i].Name = dgvCFamily.Rows[i].Cells["CFamily_Name"].Value.ToString();

                    //if (dgvCFamily.Rows[i].Cells["CFamily_DOB"].Value.ToString() == "")
                    //    tracks[i].BirthYear = DateTime.MinValue;
                    //else
                        //tracks[i].BirthYear = Convert.ToDateTime(dgvCFamily.Rows[i].Cells["CFamily_DOB"].Value);
                        tracks[i].BirthYear = Convert.ToString(dgvCFamily.Rows[i].Cells["CFamily_DOB"].Value);
                    tracks[i].Relationship = dgvCFamily.Rows[i].Cells["CFamily_Relationship"].Value.ToString();
                    tracks[i].Address = dgvCFamily.Rows[i].Cells["CFamily_Address"].Value.ToString();
                    tracks[i].Occupation = dgvCFamily.Rows[i].Cells["CFamily_Employment"].Value.ToString();
                    tracks[i].IsDependent = Convert.ToBoolean(dgvCFamily.Rows[i].Cells["CFamily_IsDependent"].Value);
                    tracks[i].Description = "";
                }
                return tracks;
            }
            else
            {
                return null;
            }

        }

        private CertificateInfo[] ReadCertificate()
        {

            if (_CandidateInfo.ID > 0)
            {
                int n = dgvCC.Rows.Count;
                CertificateInfo[] tracks = new CertificateInfo[n];
                for (int i = 0; i < n; i++)
                {
                    tracks[i] = new CertificateInfo();
                    tracks[i].ID = 0;
                    tracks[i].EmployeeID = _EmployeeInfo.ID;
                    tracks[i].Name = dgvCC.Rows[i].Cells["CC_Name"].Value.ToString();
                    tracks[i].AuthorityIssue = dgvCC.Rows[i].Cells["CC_AuthorityIssue"].Value.ToString();

                    if (dgvCC.Rows[i].Cells["CC_IssueDate"].Value.ToString() == "")
                        tracks[i].IssueDate = DateTime.MinValue;
                    else
                        tracks[i].IssueDate = UISetting.GetDate(dgvCC.Rows[i].Cells["CC_IssueDate"].Value.ToString());

                    tracks[i].Grade = dgvCC.Rows[i].Cells["CC_Grade"].Value.ToString();
                    tracks[i].Speciality = dgvCC.Rows[i].Cells["CC_Speciality"].Value.ToString();
                    tracks[i].Description = "";

                }
                return tracks;
            }
            else
            {
                return null;
            }

        }

        private void cboYear_SelectedIndexChanged(object sender, EventArgs e)
        {
            UISetting.LoadRecruitment(ref cboRecruitment, Convert.ToInt32(cboYear.SelectedValue));
            //cboRecruitment.SelectedIndex = 0;
        }

        private void frmCR_Load(object sender, EventArgs e)
        {
            if (dgvCC.Columns.Count > 0)
            {
                dgvCC.Columns["CC_RowNumber"].HeaderText = UpdateUI.GetString("stt");
                dgvCC.Columns["CC_AuthorityIssue"].HeaderText = UpdateUI.GetString("tentruong");
                dgvCC.Columns["CC_Command"].HeaderText = UpdateUI.GetString("lenh");
            }
            if (dgvCWB.Columns.Count > 0)
            {
                dgvCWB.Columns["CWB_RowNumber"].HeaderText = UpdateUI.GetString("stt");
                dgvCWB.Columns["CWB_CompanyName"].HeaderText = UpdateUI.GetString("congty");
                dgvCWB.Columns["CWB_Command"].HeaderText = UpdateUI.GetString("lenh");
            }
            if (dgvCFamily.Columns.Count > 0)
            {
                dgvCFamily.Columns["CFamily_RowNumber"].HeaderText = UpdateUI.GetString("stt");
                dgvCFamily.Columns["CFamily_Name"].HeaderText = UpdateUI.GetString("hovaten");
                dgvCFamily.Columns["CFamily_Command"].HeaderText = UpdateUI.GetString("lenh");
            }
            if (dgvCLanguage.Columns.Count > 0)
            {
                dgvCLanguage.Columns["CLanguage_RowNumber"].HeaderText = UpdateUI.GetString("stt");
                dgvCLanguage.Columns["CLanguage_Name"].HeaderText = UpdateUI.GetString("ngonngu");
                dgvCLanguage.Columns["CLanguage_Command"].HeaderText = UpdateUI.GetString("lenh");
            }

        }

        #region CCriteriaOut

        private void CCriteriaOut()
        {
            try
            {
                #region Phỏng vấn lần 1
                DataTable dt = _wcfCCriteria.CCriteria_GetByCandidate(_CandidateInfo.ID).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        switch (dt.Rows[i]["CCriteria_Name"].ToString())
                        {
                            case "Kiến thức (về nghiệp vụ dự tuyển)":
                                txtKnowledge.Text = dt.Rows[i]["CCriteria_Point"].ToString();
                                break;
                            case "Kinh nghiệm":
                                txtExperiance.Text = dt.Rows[i]["CCriteria_Point"].ToString();
                                break;
                            case "Hiểu biết về Công ty":
                                txtCompany.Text = dt.Rows[i]["CCriteria_Point"].ToString();
                                break;
                            case "Khả năng giao tiếp":
                                txtSpeak.Text = dt.Rows[i]["CCriteria_Point"].ToString();
                                break;
                            case "Diện mạo, tính cách":
                                txtInterface.Text = dt.Rows[i]["CCriteria_Point"].ToString();
                                break;
                            case "Tổng điểm":
                                txtTotal.Text = dt.Rows[i]["CCriteria_Point"].ToString();
                                break;
                        }
                    }
                }


                //CCriteriaInfo info12 = new CCriteriaInfo();
                //info12 = _wcfCCriteria.CCriteria_GetInfo(_CandidateInfo.ID, lblPersonality1.Text, 1, _CRInfo.RecruitmentID);
                //if (info12 != null)
                //{
                //    chkUnpleasant1.Checked = info12.Point.Contains("Unpleasant");
                //    chkNeedseffort1.Checked = info12.Point.Contains("Needs effort");
                //    chkLikeable1.Checked = info12.Point.Contains("Likeable");
                //    chkPleasing1.Checked = info12.Point.Contains("Pleasing");
                //    chkWarmCharming1.Checked = info12.Point.Contains("Warm Charming");
                //    txtCom12.Text = info12.Comments;
                //}

                //CCriteriaInfo info13 = new CCriteriaInfo();
                //info13 = _wcfCCriteria.CCriteria_GetInfo(_CandidateInfo.ID, lblMotivation1.Text, 1, _CRInfo.RecruitmentID);
                //if (info13 != null)
                //{
                //    chkNodriver1.Checked = info13.Point.Contains("No driver");
                //    chkDoubtfullInterest1.Checked = info13.Point.Contains("Doubtfull Interest");
                //    chkSincereDesire1.Checked = info13.Point.Contains("Sincere Desire");
                //    chkStrongInterest1.Checked = info13.Point.Contains("Strong Interest");
                //    chkHighlymotivated1.Checked = info13.Point.Contains("Highly motivated");
                //    txtCom13.Text = info13.Comments;
                //}

                //CCriteriaInfo info14 = new CCriteriaInfo();
                //info14 = _wcfCCriteria.CCriteria_GetInfo(_CandidateInfo.ID, lblCommnication1.Text, 1, _CRInfo.RecruitmentID);
                //if (info14 != null)
                //{
                //    chkConfusedPoor1.Checked = info14.Point.Contains("Confused Poor");
                //    chkHazy1.Checked = info14.Point.Contains("Hazy");
                //    chkAnswertoQuestions1.Checked = info14.Point.Contains("Answer to Questions");
                //    chkSpeakswithconfidence1.Checked = info14.Point.Contains("Speaks with confidence");
                //    chkConciseClearthoughts1.Checked = info14.Point.Contains("Concise/Clear thoughts");
                //    txtCom14.Text = info14.Comments;
                //}

                //CCriteriaInfo info15 = new CCriteriaInfo();
                //info15 = _wcfCCriteria.CCriteria_GetInfo(_CandidateInfo.ID, lblQualification1.Text, 1, _CRInfo.RecruitmentID);
                //if (info15 != null)
                //{
                //    chkNotAdequate1.Checked = info15.Point.Contains("Not Adequate");
                //    chkMarginal1.Checked = info15.Point.Contains("Marginal");
                //    chkSuitable1.Checked = info15.Point.Contains("Suitable");
                //    chkWelqualified1.Checked = info15.Point.Contains("Well qualified");
                //    chkIdeal1.Checked = info15.Point.Contains("Ideal");
                //    txtCom15.Text = info15.Comments;
                //}

                //CCriteriaInfo info16 = new CCriteriaInfo();
                //info16 = _wcfCCriteria.CCriteria_GetInfo(_CandidateInfo.ID, lblJobKnowledge1.Text, 1, _CRInfo.RecruitmentID);
                //if (info16 != null)
                //{
                //    chkNone1.Checked = info16.Point.Contains("None");
                //    chkNeedsTraning1.Checked = info16.Point.Contains("Needs Traning");
                //    chkBasicKnowledge1.Checked = info16.Point.Contains("Basic Knowledge");
                //    chkGoodKnowledge1.Checked = info16.Point.Contains("Good Knowledge");
                //    chkExcellentKnowledge1.Checked = info16.Point.Contains("Excellent Knowledge");
                //    txtCom16.Text = info16.Comments;
                //}

                #endregion

                #region Phỏng vấn lần 2

                CCriteriaInfo info21 = new CCriteriaInfo();
                info21 = _wcfCCriteria.CCriteria_GetInfo(_CandidateInfo.ID, lblAppearance2.Text, 2, _CRInfo.RecruitmentID);
                if (info21 != null)
                {
                    chkSloppy2.Checked = info21.Point.Contains("Sloppy");
                    chkNotOrganized2.Checked = info21.Point.Contains("Not Organized");
                    chkFunction2.Checked = info21.Point.Contains("Function");
                    chkWellGroomed2.Checked = info21.Point.Contains("Well Groomed");
                    chkProfessionallooking2.Checked = info21.Point.Contains("Professional looking");
                    txtCom21.Text = info21.Comments;
                }

                CCriteriaInfo info22 = new CCriteriaInfo();
                info22 = _wcfCCriteria.CCriteria_GetInfo(_CandidateInfo.ID, lblPersonality2.Text, 2, _CRInfo.RecruitmentID);
                if (info22 != null)
                {
                    chkUnpleasant2.Checked = info22.Point.Contains("Unpleasant");
                    chkNeedseffort2.Checked = info22.Point.Contains("Needs effort");
                    chkLikeable2.Checked = info22.Point.Contains("Likeable");
                    chkPleasing2.Checked = info22.Point.Contains("Pleasing");
                    chkWarmCharming2.Checked = info22.Point.Contains("Warm Charming");
                    txtCom22.Text = info22.Comments;
                }

                CCriteriaInfo info23 = new CCriteriaInfo();
                info23 = _wcfCCriteria.CCriteria_GetInfo(_CandidateInfo.ID, lblMotivation2.Text, 2, _CRInfo.RecruitmentID);
                if (info23 != null)
                {
                    chkNodriver2.Checked = info23.Point.Contains("No driver");
                    chkDoubtfullInterest2.Checked = info23.Point.Contains("Doubtfull Interest");
                    chkSincereDesire2.Checked = info23.Point.Contains("Sincere Desire");
                    chkStrongInterest2.Checked = info23.Point.Contains("Strong Interest");
                    chkHighlymotivated2.Checked = info23.Point.Contains("Highly motivated");
                    txtCom23.Text = info23.Comments;
                }

                CCriteriaInfo info24 = new CCriteriaInfo();
                info24 = _wcfCCriteria.CCriteria_GetInfo(_CandidateInfo.ID, lblCommnication2.Text, 2, _CRInfo.RecruitmentID);
                if (info24 != null)
                {
                    chkConfusedPoor2.Checked = info24.Point.Contains("Confused Poor");
                    chkHazy2.Checked = info24.Point.Contains("Hazy");
                    chkAnswertoQuestions2.Checked = info24.Point.Contains("Answer to Questions");
                    chkSpeakswithconfidence2.Checked = info24.Point.Contains("Speaks with confidence");
                    chkConciseClearthoughts2.Checked = info24.Point.Contains("Concise/Clear thoughts");
                    txtCom24.Text = info24.Comments;
                }

                CCriteriaInfo info25 = new CCriteriaInfo();
                info25 = _wcfCCriteria.CCriteria_GetInfo(_CandidateInfo.ID, lblQualification2.Text, 2, _CRInfo.RecruitmentID);
                if (info25 != null)
                {
                    chkNotAdequate2.Checked = info25.Point.Contains("Not Adequate");
                    chkMarginal2.Checked = info25.Point.Contains("Marginal");
                    chkSuitable2.Checked = info25.Point.Contains("Suitable");
                    chkWelqualified2.Checked = info25.Point.Contains("Well qualified");
                    chkIdeal2.Checked = info25.Point.Contains("Ideal");
                    txtCom25.Text = info25.Comments;
                }

                CCriteriaInfo info26 = new CCriteriaInfo();
                info26 = _wcfCCriteria.CCriteria_GetInfo(_CandidateInfo.ID, lblJobKnowledge2.Text, 2, _CRInfo.RecruitmentID);
                if (info26 != null)
                {
                    chkNone2.Checked = info26.Point.Contains("None");
                    chkNeedsTraning2.Checked = info26.Point.Contains("Needs Traning");
                    chkBasicKnowledge2.Checked = info26.Point.Contains("Basic Knowledge");
                    chkGoodKnowledge2.Checked = info26.Point.Contains("Good Knowledge");
                    chkExcellentKnowledge2.Checked = info26.Point.Contains("Excellent Knowledge");
                    txtCom26.Text = info26.Comments;
                }
                #endregion

                #region Phỏng vấn lần 3

                CCriteriaInfo info31 = new CCriteriaInfo();
                info31 = _wcfCCriteria.CCriteria_GetInfo(_CandidateInfo.ID, lblAppearance3.Text, 3, _CRInfo.RecruitmentID);
                if (info31 != null)
                {
                    chkSloppy3.Checked = info31.Point.Contains("Sloppy");
                    chkNotOrganized3.Checked = info31.Point.Contains("Not Organized");
                    chkFunction3.Checked = info31.Point.Contains("Function");
                    chkWellGroomed3.Checked = info31.Point.Contains("Well Groomed");
                    chkProfessionallooking3.Checked = info31.Point.Contains("Professional looking");
                    txtCom31.Text = info31.Comments;
                }

                CCriteriaInfo info32 = new CCriteriaInfo();
                info32 = _wcfCCriteria.CCriteria_GetInfo(_CandidateInfo.ID, lblPersonality3.Text, 3, _CRInfo.RecruitmentID);
                if (info32 != null)
                {
                    chkUnpleasant3.Checked = info32.Point.Contains("Unpleasant");
                    chkNeedseffort3.Checked = info32.Point.Contains("Needs effort");
                    chkLikeable3.Checked = info32.Point.Contains("Likeable");
                    chkPleasing3.Checked = info32.Point.Contains("Pleasing");
                    chkWarmCharming3.Checked = info32.Point.Contains("Warm Charming");
                    txtCom32.Text = info32.Comments;
                }

                CCriteriaInfo info33 = new CCriteriaInfo();
                info33 = _wcfCCriteria.CCriteria_GetInfo(_CandidateInfo.ID, lblMotivation3.Text, 3, _CRInfo.RecruitmentID);
                if (info33 != null)
                {
                    chkNodriver3.Checked = info33.Point.Contains("No driver");
                    chkDoubtfullInterest3.Checked = info33.Point.Contains("Doubtfull Interest");
                    chkSincereDesire3.Checked = info33.Point.Contains("Sincere Desire");
                    chkStrongInterest3.Checked = info33.Point.Contains("Strong Interest");
                    chkHighlymotivated3.Checked = info33.Point.Contains("Highly motivated");
                    txtCom33.Text = info33.Comments;
                }

                CCriteriaInfo info34 = new CCriteriaInfo();
                info34 = _wcfCCriteria.CCriteria_GetInfo(_CandidateInfo.ID, lblCommnication3.Text, 3, _CRInfo.RecruitmentID);
                if (info34 != null)
                {
                    chkConfusedPoor3.Checked = info34.Point.Contains("Confused Poor");
                    chkHazy3.Checked = info34.Point.Contains("Hazy");
                    chkAnswertoQuestions3.Checked = info34.Point.Contains("Answer to Questions");
                    chkSpeakswithconfidence3.Checked = info34.Point.Contains("Speaks with confidence");
                    chkConciseClearthoughts3.Checked = info34.Point.Contains("Concise/Clear thoughts");
                    txtCom34.Text = info34.Comments;
                }

                CCriteriaInfo info35 = new CCriteriaInfo();
                info35 = _wcfCCriteria.CCriteria_GetInfo(_CandidateInfo.ID, lblQualification3.Text, 3, _CRInfo.RecruitmentID);
                if (info35 != null)
                {
                    chkNotAdequate3.Checked = info35.Point.Contains("Not Adequate");
                    chkMarginal3.Checked = info35.Point.Contains("Marginal");
                    chkSuitable3.Checked = info35.Point.Contains("Suitable");
                    chkWelqualified3.Checked = info35.Point.Contains("Well qualified");
                    chkIdeal3.Checked = info35.Point.Contains("Ideal");
                    txtCom35.Text = info35.Comments;
                }

                CCriteriaInfo info36 = new CCriteriaInfo();
                info36 = _wcfCCriteria.CCriteria_GetInfo(_CandidateInfo.ID, lblJobKnowledge3.Text, 3, _CRInfo.RecruitmentID);
                if (info36 != null)
                {
                    chkNone3.Checked = info36.Point.Contains("None");
                    chkNeedsTraning3.Checked = info36.Point.Contains("Needs Traning");
                    chkBasicKnowledge3.Checked = info36.Point.Contains("Basic Knowledge");
                    chkGoodKnowledge3.Checked = info36.Point.Contains("Good Knowledge");
                    chkExcellentKnowledge3.Checked = info36.Point.Contains("Excellent Knowledge");
                    txtCom36.Text = info36.Comments;
                }
                #endregion
            }

            catch (Exception ex)
            {
                MessageBox.Show(UpdateUI.GetString("loi") + ":\n" + ex.Message + "\n" + UpdateUI.GetString("ghiloi"));
            }
        }

        #endregion

        #region SetPoint

        #region Phỏng vấn lần 1

        //string SetPoint11()
        //{
        //    //Appearance
        //    string _str = "";
        //    if (chkSloppy1.Checked)
        //        _str = chkSloppy1.Text;
        //    else if (chkNotOrganized1.Checked)
        //        _str = chkNotOrganized1.Text;
        //    else if (chkFunction1.Checked)
        //        _str = chkFunction1.Text;
        //    else if (chkWellGroomed1.Checked)
        //        _str = chkWellGroomed1.Text;
        //    else if (chkProfessionallooking1.Checked)
        //        _str = chkProfessionallooking1.Text;
        //    return _str;
        //}
        //string SetPoint12()
        //{
        //    //Personality
        //    string _str = "";
        //    if (chkUnpleasant1.Checked)
        //        _str = chkUnpleasant1.Text;
        //    else if (chkNeedseffort1.Checked)
        //        _str = chkNeedseffort1.Text;
        //    else if (chkLikeable1.Checked)
        //        _str = chkLikeable1.Text;
        //    else if (chkPleasing1.Checked)
        //        _str = chkPleasing1.Text;
        //    else if (chkWarmCharming1.Checked)
        //        _str = chkWarmCharming1.Text;
        //    return _str;
        //}
        //string SetPoint13()
        //{
        //    //Monivacation
        //    string _str = "";
        //    if (chkNodriver1.Checked)
        //        _str = chkNodriver1.Text;
        //    else if (chkDoubtfullInterest1.Checked)
        //        _str = chkDoubtfullInterest1.Text;
        //    else if (chkSincereDesire1.Checked)
        //        _str = chkSincereDesire1.Text;
        //    else if (chkStrongInterest1.Checked)
        //        _str = chkStrongInterest1.Text;
        //    else if (chkHighlymotivated1.Checked)
        //        _str = chkHighlymotivated1.Text;
        //    return _str;
        //}
        //string SetPoint14()
        //{
        //    //Commnication
        //    string _str = "";
        //    if (chkConfusedPoor1.Checked)
        //        _str = chkConfusedPoor1.Text;
        //    else if (chkHazy1.Checked)
        //        _str = chkHazy1.Text;
        //    else if (chkAnswertoQuestions1.Checked)
        //        _str = chkAnswertoQuestions1.Text;
        //    else if (chkSpeakswithconfidence1.Checked)
        //        _str = chkSpeakswithconfidence1.Text;
        //    else if (chkConciseClearthoughts1.Checked)
        //        _str = chkConciseClearthoughts1.Text;
        //    return _str;
        //}
        //string SetPoint15()
        //{
        //    //Qualification
        //    string _str = "";
        //    if (chkNotAdequate1.Checked)
        //        _str = chkNotAdequate1.Text;
        //    else if (chkMarginal1.Checked)
        //        _str = chkMarginal1.Text;
        //    else if (chkSuitable1.Checked)
        //        _str = chkSuitable1.Text;
        //    else if (chkWelqualified1.Checked)
        //        _str = chkWelqualified1.Text;
        //    else if (chkIdeal1.Checked)
        //        _str = chkIdeal1.Text;
        //    return _str;
        //}
        //string SetPoint16()
        //{
        //    //Job Knowledge
        //    string _str = "";
        //    if (chkNone1.Checked)
        //        _str = chkNone1.Text;
        //    else if (chkNeedsTraning1.Checked)
        //        _str = chkNeedsTraning1.Text;
        //    else if (chkBasicKnowledge1.Checked)
        //        _str = chkBasicKnowledge1.Text;
        //    else if (chkGoodKnowledge1.Checked)
        //        _str = chkGoodKnowledge1.Text;
        //    else if (chkExcellentKnowledge1.Checked)
        //        _str = chkExcellentKnowledge1.Text;
        //    return _str;
        //}
        #endregion

        #region Phỏng vấn lần 2
        string SetPoint21()
        {
            //Appearance
            string _str = "";
            if (chkSloppy2.Checked)
                _str = chkSloppy2.Text;
            else if (chkNotOrganized2.Checked)
                _str = chkNotOrganized2.Text;
            else if (chkFunction2.Checked)
                _str = chkFunction2.Text;
            else if (chkWellGroomed2.Checked)
                _str = chkWellGroomed2.Text;
            else if (chkProfessionallooking2.Checked)
                _str = chkProfessionallooking2.Text;
            return _str;
        }
        string SetPoint22()
        {
            //Personality
            string _str = "";
            if (chkUnpleasant2.Checked)
                _str = chkUnpleasant2.Text;
            else if (chkNeedseffort2.Checked)
                _str = chkNeedseffort2.Text;
            else if (chkLikeable2.Checked)
                _str = chkLikeable2.Text;
            else if (chkPleasing2.Checked)
                _str = chkPleasing2.Text;
            else if (chkWarmCharming2.Checked)
                _str = chkWarmCharming2.Text;
            return _str;
        }
        string SetPoint23()
        {
            //Monivacation
            string _str = "";
            if (chkNodriver2.Checked)
                _str = chkNodriver2.Text;
            else if (chkDoubtfullInterest2.Checked)
                _str = chkDoubtfullInterest2.Text;
            else if (chkSincereDesire2.Checked)
                _str = chkSincereDesire2.Text;
            else if (chkStrongInterest2.Checked)
                _str = chkStrongInterest2.Text;
            else if (chkHighlymotivated2.Checked)
                _str = chkHighlymotivated2.Text;
            return _str;
        }
        string SetPoint24()
        {
            //Commnication
            string _str = "";
            if (chkConfusedPoor2.Checked)
                _str = chkConfusedPoor2.Text;
            else if (chkHazy2.Checked)
                _str = chkHazy2.Text;
            else if (chkAnswertoQuestions2.Checked)
                _str = chkAnswertoQuestions2.Text;
            else if (chkSpeakswithconfidence2.Checked)
                _str = chkSpeakswithconfidence2.Text;
            else if (chkConciseClearthoughts2.Checked)
                _str = chkConciseClearthoughts2.Text;
            return _str;
        }
        string SetPoint25()
        {
            //Qualification
            string _str = "";
            if (chkNotAdequate2.Checked)
                _str = chkNotAdequate2.Text;
            else if (chkMarginal2.Checked)
                _str = chkMarginal2.Text;
            else if (chkSuitable2.Checked)
                _str = chkSuitable2.Text;
            else if (chkWelqualified2.Checked)
                _str = chkWelqualified2.Text;
            else if (chkIdeal2.Checked)
                _str = chkIdeal2.Text;
            return _str;
        }
        string SetPoint26()
        {
            //Job Knowledge
            string _str = "";
            if (chkNone2.Checked)
                _str = chkNone2.Text;
            else if (chkNeedsTraning2.Checked)
                _str = chkNeedsTraning2.Text;
            else if (chkBasicKnowledge2.Checked)
                _str = chkBasicKnowledge2.Text;
            else if (chkGoodKnowledge2.Checked)
                _str = chkGoodKnowledge2.Text;
            else if (chkExcellentKnowledge2.Checked)
                _str = chkExcellentKnowledge2.Text;
            return _str;
        }
        #endregion

        #region Phỏng vấn lần 3
        string SetPoint31()
        {
            //Appearance
            string _str = "";
            if (chkSloppy3.Checked)
                _str = chkSloppy3.Text;
            else if (chkNotOrganized3.Checked)
                _str = chkNotOrganized3.Text;
            else if (chkFunction3.Checked)
                _str = chkFunction3.Text;
            else if (chkWellGroomed3.Checked)
                _str = chkWellGroomed3.Text;
            else if (chkProfessionallooking3.Checked)
                _str = chkProfessionallooking3.Text;
            return _str;
        }
        string SetPoint32()
        {
            //Personality
            string _str = "";
            if (chkUnpleasant3.Checked)
                _str = chkUnpleasant3.Text;
            else if (chkNeedseffort3.Checked)
                _str = chkNeedseffort3.Text;
            else if (chkLikeable3.Checked)
                _str = chkLikeable3.Text;
            else if (chkPleasing3.Checked)
                _str = chkPleasing3.Text;
            else if (chkWarmCharming3.Checked)
                _str = chkWarmCharming3.Text;
            return _str;
        }
        string SetPoint33()
        {
            //Monivacation
            string _str = "";
            if (chkNodriver3.Checked)
                _str = chkNodriver3.Text;
            else if (chkDoubtfullInterest3.Checked)
                _str = chkDoubtfullInterest3.Text;
            else if (chkSincereDesire3.Checked)
                _str = chkSincereDesire3.Text;
            else if (chkStrongInterest3.Checked)
                _str = chkStrongInterest3.Text;
            else if (chkHighlymotivated3.Checked)
                _str = chkHighlymotivated3.Text;
            return _str;
        }
        string SetPoint34()
        {
            //Commnication
            string _str = "";
            if (chkConfusedPoor3.Checked)
                _str = chkConfusedPoor3.Text;
            else if (chkHazy3.Checked)
                _str = chkHazy3.Text;
            else if (chkAnswertoQuestions3.Checked)
                _str = chkAnswertoQuestions3.Text;
            else if (chkSpeakswithconfidence3.Checked)
                _str = chkSpeakswithconfidence3.Text;
            else if (chkConciseClearthoughts3.Checked)
                _str = chkConciseClearthoughts3.Text;
            return _str;
        }
        string SetPoint35()
        {
            //Qualification
            string _str = "";
            if (chkNotAdequate3.Checked)
                _str = chkNotAdequate3.Text;
            else if (chkMarginal3.Checked)
                _str = chkMarginal3.Text;
            else if (chkSuitable3.Checked)
                _str = chkSuitable3.Text;
            else if (chkWelqualified3.Checked)
                _str = chkWelqualified3.Text;
            else if (chkIdeal3.Checked)
                _str = chkIdeal3.Text;
            return _str;
        }
        string SetPoint36()
        {
            //Job Knowledge
            string _str = "";
            if (chkNone3.Checked)
                _str = chkNone3.Text;
            else if (chkNeedsTraning3.Checked)
                _str = chkNeedsTraning3.Text;
            else if (chkBasicKnowledge3.Checked)
                _str = chkBasicKnowledge3.Text;
            else if (chkGoodKnowledge3.Checked)
                _str = chkGoodKnowledge3.Text;
            else if (chkExcellentKnowledge3.Checked)
                _str = chkExcellentKnowledge3.Text;
            return _str;
        }
        #endregion

        #endregion

        #region ReadCCriteria

        #region Phỏng vấn lần 1
        private CCriteriaInfo ReadCriteria11()
        {
            //Knowledge
            if (_CandidateInfo.ID > 0)
            {
                CCriteriaInfo info = new CCriteriaInfo();

                info.ID = 0;
                info.CandidateID = _CandidateInfo.ID;
                info.Name = lblKnowledge.Text;
                info.Ordinal = 1;
                info.Point = txtKnowledge.Text;
                info.Comments = txtKnowledge.Text;
                info.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                return info;
            }
            else
            {
                return null;
            }
        }
        private CCriteriaInfo ReadCriteria12()
        {
            //Experiance
            if (_CandidateInfo.ID > 0)
            {
                CCriteriaInfo info = new CCriteriaInfo();

                info.ID = 0;
                info.CandidateID = _CandidateInfo.ID;
                info.Name = lblExperiance.Text;
                info.Ordinal = 1;
                info.Point = txtExperiance.Text;
                info.Comments = txtExperiance.Text;
                info.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                return info;
            }
            else
            {
                return null;
            }
        }
        private CCriteriaInfo ReadCriteria13()
        {
            //Motivation
            if (_CandidateInfo.ID > 0)
            {
                CCriteriaInfo info = new CCriteriaInfo();

                info.ID = 0;
                info.CandidateID = _CandidateInfo.ID;
                info.Name = lblCompany.Text;
                info.Ordinal = 1;
                info.Point = txtCompany.Text;
                info.Comments = txtCompany.Text;
                info.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                return info;
            }
            else
            {
                return null;
            }
        }
        private CCriteriaInfo ReadCriteria14()
        {
            //Speak
            if (_CandidateInfo.ID > 0)
            {
                CCriteriaInfo info = new CCriteriaInfo();

                info.ID = 0;
                info.CandidateID = _CandidateInfo.ID;
                info.Name = lblSpeak.Text;
                info.Ordinal = 1;
                info.Point = txtSpeak.Text;
                info.Comments = txtSpeak.Text;
                info.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                return info;
            }
            else
            {
                return null;
            }
        }
        private CCriteriaInfo ReadCriteria15()
        {
            //Interface
            if (_CandidateInfo.ID > 0)
            {
                CCriteriaInfo info = new CCriteriaInfo();

                info.ID = 0;
                info.CandidateID = _CandidateInfo.ID;
                info.Name = lblInterface.Text;
                info.Ordinal = 1;
                info.Point = txtInterface.Text;
                info.Comments = txtInterface.Text;
                info.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                return info;
            }
            else
            {
                return null;
            }
        }
        private CCriteriaInfo ReadCriteria16()
        {
            //Total
            if (_CandidateInfo.ID > 0)
            {
                CCriteriaInfo info = new CCriteriaInfo();

                info.ID = 0;
                info.CandidateID = _CandidateInfo.ID;
                info.Name = lblTotal.Text;
                info.Ordinal = 1;
                info.Point = txtTotal.Text;
                info.Comments = txtTotal.Text;
                info.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                return info;
            }
            else
            {
                return null;
            }
        }
        #endregion

        #region Phỏng vấn lần 2
        private CCriteriaInfo ReadCriteria21()
        {
            //Appearance
            if (_CandidateInfo.ID > 0)
            {
                CCriteriaInfo info = new CCriteriaInfo();

                info.ID = 0;
                info.CandidateID = _CandidateInfo.ID;
                info.Name = lblAppearance2.Text;
                info.Ordinal = 2;
                info.Point = SetPoint21();
                info.Comments = txtCom21.Text;
                info.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                return info;
            }
            else
            {
                return null;
            }
        }
        private CCriteriaInfo ReadCriteria22()
        {
            //Personality
            if (_CandidateInfo.ID > 0)
            {
                CCriteriaInfo info = new CCriteriaInfo();

                info.ID = 0;
                info.CandidateID = _CandidateInfo.ID;
                info.Name = lblPersonality2.Text;
                info.Ordinal = 2;
                info.Point = SetPoint22();
                info.Comments = txtCom22.Text;
                info.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                return info;
            }
            else
            {
                return null;
            }
        }
        private CCriteriaInfo ReadCriteria23()
        {
            //Motivation
            if (_CandidateInfo.ID > 0)
            {
                CCriteriaInfo info = new CCriteriaInfo();

                info.ID = 0;
                info.CandidateID = _CandidateInfo.ID;
                info.Name = lblMotivation2.Text;
                info.Ordinal = 2;
                info.Point = SetPoint23();
                info.Comments = txtCom23.Text;
                info.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                return info;
            }
            else
            {
                return null;
            }
        }
        private CCriteriaInfo ReadCriteria24()
        {
            //Commnication
            if (_CandidateInfo.ID > 0)
            {
                CCriteriaInfo info = new CCriteriaInfo();

                info.ID = 0;
                info.CandidateID = _CandidateInfo.ID;
                info.Name = lblCommnication2.Text;
                info.Ordinal = 2;
                info.Point = SetPoint24();
                info.Comments = txtCom24.Text;
                info.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                return info;
            }
            else
            {
                return null;
            }
        }
        private CCriteriaInfo ReadCriteria25()
        {
            //Commnication
            if (_CandidateInfo.ID > 0)
            {
                CCriteriaInfo info = new CCriteriaInfo();

                info.ID = 0;
                info.CandidateID = _CandidateInfo.ID;
                info.Name = lblQualification2.Text;
                info.Ordinal = 2;
                info.Point = SetPoint25();
                info.Comments = txtCom25.Text;
                info.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                return info;
            }
            else
            {
                return null;
            }
        }
        private CCriteriaInfo ReadCriteria26()
        {
            //Commnication
            if (_CandidateInfo.ID > 0)
            {
                CCriteriaInfo info = new CCriteriaInfo();

                info.ID = 0;
                info.CandidateID = _CandidateInfo.ID;
                info.Name = lblJobKnowledge2.Text;
                info.Ordinal = 2;
                info.Point = SetPoint26();
                info.Comments = txtCom26.Text;
                info.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                return info;
            }
            else
            {
                return null;
            }
        }
        #endregion

        #region Phỏng vấn lần 3
        private CCriteriaInfo ReadCriteria31()
        {
            //Appearance
            if (_CandidateInfo.ID > 0)
            {
                CCriteriaInfo info = new CCriteriaInfo();

                info.ID = 0;
                info.CandidateID = _CandidateInfo.ID;
                info.Name = lblAppearance3.Text;
                info.Ordinal = 3;
                info.Point = SetPoint31();
                info.Comments = txtCom31.Text;
                info.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                return info;
            }
            else
            {
                return null;
            }
        }
        private CCriteriaInfo ReadCriteria32()
        {
            //Personality
            if (_CandidateInfo.ID > 0)
            {
                CCriteriaInfo info = new CCriteriaInfo();

                info.ID = 0;
                info.CandidateID = _CandidateInfo.ID;
                info.Name = lblPersonality3.Text;
                info.Ordinal = 3;
                info.Point = SetPoint32();
                info.Comments = txtCom32.Text;
                info.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                return info;
            }
            else
            {
                return null;
            }
        }
        private CCriteriaInfo ReadCriteria33()
        {
            //Motivation
            if (_CandidateInfo.ID > 0)
            {
                CCriteriaInfo info = new CCriteriaInfo();

                info.ID = 0;
                info.CandidateID = _CandidateInfo.ID;
                info.Name = lblMotivation3.Text;
                info.Ordinal = 3;
                info.Point = SetPoint33();
                info.Comments = txtCom33.Text;
                info.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                return info;
            }
            else
            {
                return null;
            }
        }
        private CCriteriaInfo ReadCriteria34()
        {
            //Commnication
            if (_CandidateInfo.ID > 0)
            {
                CCriteriaInfo info = new CCriteriaInfo();

                info.ID = 0;
                info.CandidateID = _CandidateInfo.ID;
                info.Name = lblCommnication3.Text;
                info.Ordinal = 3;
                info.Point = SetPoint34();
                info.Comments = txtCom34.Text;
                info.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                return info;
            }
            else
            {
                return null;
            }
        }
        private CCriteriaInfo ReadCriteria35()
        {
            //Commnication
            if (_CandidateInfo.ID > 0)
            {
                CCriteriaInfo info = new CCriteriaInfo();

                info.ID = 0;
                info.CandidateID = _CandidateInfo.ID;
                info.Name = lblQualification3.Text;
                info.Ordinal = 3;
                info.Point = SetPoint35();
                info.Comments = txtCom35.Text;
                info.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                return info;
            }
            else
            {
                return null;
            }
        }
        private CCriteriaInfo ReadCriteria36()
        {
            //Commnication
            if (_CandidateInfo.ID > 0)
            {
                CCriteriaInfo info = new CCriteriaInfo();

                info.ID = 0;
                info.CandidateID = _CandidateInfo.ID;
                info.Name = lblJobKnowledge3.Text;
                info.Ordinal = 3;
                info.Point = SetPoint36();
                info.Comments = txtCom36.Text;
                info.RecruitmentID = Convert.ToInt32(cboRecruitment.SelectedValue);
                return info;
            }
            else
            {
                return null;
            }
        }
        #endregion

        private void CCriteria_Save()
        {
            try
            {
                _wcfCCriteria.CCriteria_Delete(_CandidateInfo.ID, Convert.ToInt32(cboRecruitment.SelectedValue));

                #region Phỏng vấn lần 1
                CCriteriaInfo info11 = new CCriteriaInfo();
                info11 = ReadCriteria11();
                if (_wcfCCriteria.CCriteria_Insert(info11) == -1)
                {
                    MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                CCriteriaInfo info12 = new CCriteriaInfo();
                info12 = ReadCriteria12();
                if (_wcfCCriteria.CCriteria_Insert(info12) == -1)
                {
                    MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                CCriteriaInfo info13 = new CCriteriaInfo();
                info13 = ReadCriteria13();
                if (_wcfCCriteria.CCriteria_Insert(info13) == -1)
                {
                    MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                CCriteriaInfo info14 = new CCriteriaInfo();
                info14 = ReadCriteria14();
                if (_wcfCCriteria.CCriteria_Insert(info14) == -1)
                {
                    MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                CCriteriaInfo info15 = new CCriteriaInfo();
                info15 = ReadCriteria15();
                if (_wcfCCriteria.CCriteria_Insert(info15) == -1)
                {
                    MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                CCriteriaInfo info16 = new CCriteriaInfo();
                info16 = ReadCriteria16();
                if (_wcfCCriteria.CCriteria_Insert(info16) == -1)
                {
                    MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                #endregion

                #region Phỏng vấn lần 2
                //CCriteriaInfo info21 = new CCriteriaInfo();
                //info21 = ReadCriteria21();
                //if (_wcfCCriteria.CCriteria_Insert(info21) == -1)
                //{
                //    MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //    return;
                //}

                //CCriteriaInfo info22 = new CCriteriaInfo();
                //info22 = ReadCriteria22();
                //if (_wcfCCriteria.CCriteria_Insert(info22) == -1)
                //{
                //    MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //    return;
                //}
                //CCriteriaInfo info23 = new CCriteriaInfo();
                //info23 = ReadCriteria23();
                //if (_wcfCCriteria.CCriteria_Insert(info23) == -1)
                //{
                //    MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //    return;
                //}
                //CCriteriaInfo info24 = new CCriteriaInfo();
                //info24 = ReadCriteria24();
                //if (_wcfCCriteria.CCriteria_Insert(info24) == -1)
                //{
                //    MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //    return;
                //}
                //CCriteriaInfo info25 = new CCriteriaInfo();
                //info25 = ReadCriteria25();
                //if (_wcfCCriteria.CCriteria_Insert(info25) == -1)
                //{
                //    MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //    return;
                //}
                //CCriteriaInfo info26 = new CCriteriaInfo();
                //info26 = ReadCriteria26();
                //if (_wcfCCriteria.CCriteria_Insert(info26) == -1)
                //{
                //    MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //    return;
                //}
                #endregion

                #region Phỏng vấn lần 3
                //CCriteriaInfo info31 = new CCriteriaInfo();
                //info31 = ReadCriteria31();
                //if (_wcfCCriteria.CCriteria_Insert(info31) == -1)
                //{
                //    MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //    return;
                //}

                //CCriteriaInfo info32 = new CCriteriaInfo();
                //info32 = ReadCriteria32();
                //if (_wcfCCriteria.CCriteria_Insert(info32) == -1)
                //{
                //    MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //    return;
                //}
                //CCriteriaInfo info33 = new CCriteriaInfo();
                //info33 = ReadCriteria33();
                //if (_wcfCCriteria.CCriteria_Insert(info33) == -1)
                //{
                //    MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //    return;
                //}
                //CCriteriaInfo info34 = new CCriteriaInfo();
                //info34 = ReadCriteria34();
                //if (_wcfCCriteria.CCriteria_Insert(info34) == -1)
                //{
                //    MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //    return;
                //}
                //CCriteriaInfo info35 = new CCriteriaInfo();
                //info35 = ReadCriteria35();
                //if (_wcfCCriteria.CCriteria_Insert(info35) == -1)
                //{
                //    MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //    return;
                //}
                //CCriteriaInfo info36 = new CCriteriaInfo();
                //info36 = ReadCriteria36();
                //if (_wcfCCriteria.CCriteria_Insert(info36) == -1)
                //{
                //    MessageBox.Show(UpdateUI.GetString("masodatontai"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //    return;
                //}
                #endregion
            }
            catch (Exception ex)
            {
                MessageBox.Show(UpdateUI.GetString("loi") + ":\n" + ex.Message + "\n" + UpdateUI.GetString("ghiloi"));
            }
        }
        #endregion

        #region Event CheckBoxChange

        //private void chkSloppy1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkSloppy1.Checked)
        //    {
        //        chkSloppy1.ForeColor = Color.Red;
        //        chkNotOrganized1.Checked = chkFunction1.Checked = chkWellGroomed1.Checked = chkProfessionallooking1.Checked = false;
        //        chkNotOrganized1.ForeColor = Color.Black;
        //    }
        //    else
        //        chkSloppy1.ForeColor = Color.Black;
        //}

        //private void chkNotOrganized1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkNotOrganized1.Checked)
        //    {
        //        chkNotOrganized1.ForeColor = Color.Red;
        //        chkSloppy1.Checked = chkFunction1.Checked = chkWellGroomed1.Checked = chkProfessionallooking1.Checked = false;
        //    }
        //    else
        //        chkNotOrganized1.ForeColor = Color.Black;
        //}

        //private void chkFunction1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkFunction1.Checked)
        //    {
        //        chkFunction1.ForeColor = Color.Red;
        //        chkSloppy1.Checked = chkNotOrganized1.Checked = chkWellGroomed1.Checked = chkProfessionallooking1.Checked = false;
        //    }
        //    else
        //        chkFunction1.ForeColor = Color.Black;
        //}

        //private void chkWellGroomed1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkWellGroomed1.Checked)
        //    {
        //        chkWellGroomed1.ForeColor = Color.Red;
        //        chkSloppy1.Checked = chkNotOrganized1.Checked = chkFunction1.Checked = chkProfessionallooking1.Checked = false;
        //    }
        //    else
        //        chkWellGroomed1.ForeColor = Color.Black;

        //}

        //private void chkProfessionallooking1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkProfessionallooking1.Checked)
        //    {
        //        chkProfessionallooking1.ForeColor = Color.Red;
        //        chkSloppy1.Checked = chkNotOrganized1.Checked = chkFunction1.Checked = chkWellGroomed1.Checked = false;
        //    }
        //    else
        //        chkProfessionallooking1.ForeColor = Color.Black;
        //}


        //private void chkUnpleasant1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkUnpleasant1.Checked)
        //    {
        //        chkUnpleasant1.ForeColor = Color.Red;
        //        chkNeedseffort1.Checked = chkLikeable1.Checked = chkPleasing1.Checked = chkWarmCharming1.Checked = false;
        //    }
        //    else
        //        chkUnpleasant1.ForeColor = Color.Black;
        //}

        //private void chkNeedseffort1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkNeedseffort1.Checked)
        //    {
        //        chkNeedseffort1.ForeColor = Color.Red;
        //        chkUnpleasant1.Checked = chkLikeable1.Checked = chkPleasing1.Checked = chkWarmCharming1.Checked = false;
        //    }
        //    else
        //        chkNeedseffort1.ForeColor = Color.Black;
        //}

        //private void chkLikeable1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkLikeable1.Checked)
        //    {
        //        chkLikeable1.ForeColor = Color.Red;
        //        chkUnpleasant1.Checked = chkNeedseffort1.Checked = chkPleasing1.Checked = chkWarmCharming1.Checked = false;
        //    }
        //    else
        //        chkLikeable1.ForeColor = Color.Black;
        //}

        //private void chkPleasing1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkPleasing1.Checked)
        //    {
        //        chkPleasing1.ForeColor = Color.Red;
        //        chkUnpleasant1.Checked = chkNeedseffort1.Checked = chkLikeable1.Checked = chkWarmCharming1.Checked = false;
        //    }
        //    else
        //        chkPleasing1.ForeColor = Color.Black;
        //}

        //private void chkWarmCharming1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkWarmCharming1.Checked)
        //    {
        //        chkWarmCharming1.ForeColor = Color.Red;
        //        chkUnpleasant1.Checked = chkNeedseffort1.Checked = chkLikeable1.Checked = chkPleasing1.Checked = false;
        //    }
        //    else
        //        chkWarmCharming1.ForeColor = Color.Black;
        //}


        //private void chkNodriver1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkNodriver1.Checked)
        //    {
        //        chkNodriver1.ForeColor = Color.Red;
        //        chkDoubtfullInterest1.Checked = chkSincereDesire1.Checked = chkStrongInterest1.Checked = chkHighlymotivated1.Checked = false;
        //    }
        //    else
        //        chkNodriver1.ForeColor = Color.Black;
        //}

        //private void chkDoubtfullInterest1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkDoubtfullInterest1.Checked)
        //    {
        //        chkDoubtfullInterest1.ForeColor = Color.Red;
        //        chkNodriver1.Checked = chkSincereDesire1.Checked = chkStrongInterest1.Checked = chkHighlymotivated1.Checked = false;
        //    }
        //    else
        //        chkDoubtfullInterest1.ForeColor = Color.Black;
        //}

        //private void chkSincereDesire1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkSincereDesire1.Checked)
        //    {
        //        chkSincereDesire1.ForeColor = Color.Red;
        //        chkNodriver1.Checked = chkDoubtfullInterest1.Checked = chkStrongInterest1.Checked = chkHighlymotivated1.Checked = false;
        //    }
        //    else
        //        chkSincereDesire1.ForeColor = Color.Black;
        //}

        //private void chkStrongInterest1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkStrongInterest1.Checked)
        //    {
        //        chkStrongInterest1.ForeColor = Color.Red;
        //        chkNodriver1.Checked = chkDoubtfullInterest1.Checked = chkSincereDesire1.Checked = chkHighlymotivated1.Checked = false;
        //    }
        //    else
        //        chkStrongInterest1.ForeColor = Color.Black;
        //}

        //private void chkHighlymotivated1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkHighlymotivated1.Checked)
        //    {
        //        chkHighlymotivated1.ForeColor = Color.Red;
        //        chkNodriver1.Checked = chkDoubtfullInterest1.Checked = chkSincereDesire1.Checked = chkStrongInterest1.Checked = false;
        //    }
        //    else
        //        chkHighlymotivated1.ForeColor = Color.Black;
        //}

        //private void chkConfusedPoor1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkConfusedPoor1.Checked)
        //    {
        //        chkConfusedPoor1.ForeColor = Color.Red;
        //        chkHazy1.Checked = chkAnswertoQuestions1.Checked = chkSpeakswithconfidence1.Checked = chkConciseClearthoughts1.Checked = false;
        //    }
        //    else
        //        chkConfusedPoor1.ForeColor = Color.Black;
        //}

        //private void chkHazy1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkHazy1.Checked)
        //    {
        //        chkHazy1.ForeColor = Color.Red;
        //        chkConfusedPoor1.Checked = chkAnswertoQuestions1.Checked = chkSpeakswithconfidence1.Checked = chkConciseClearthoughts1.Checked = false;
        //    }
        //    else
        //        chkHazy1.ForeColor = Color.Black;
        //}

        //private void chkAnswertoQuestions1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkAnswertoQuestions1.Checked)
        //    {
        //        chkAnswertoQuestions1.ForeColor = Color.Red;
        //        chkConfusedPoor1.Checked = chkHazy1.Checked = chkSpeakswithconfidence1.Checked = chkConciseClearthoughts1.Checked = false;
        //    }
        //    else
        //        chkAnswertoQuestions1.ForeColor = Color.Black;
        //}

        //private void chkSpeakswithconfidence1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkSpeakswithconfidence1.Checked)
        //    {
        //        chkSpeakswithconfidence1.ForeColor = Color.Red;
        //        chkConfusedPoor1.Checked = chkHazy1.Checked = chkAnswertoQuestions1.Checked = chkConciseClearthoughts1.Checked = false;
        //    }
        //    else
        //        chkSpeakswithconfidence1.ForeColor = Color.Black;
        //}

        //private void chkConciseClearthoughts1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkConciseClearthoughts1.Checked)
        //    {
        //        chkConciseClearthoughts1.ForeColor = Color.Red;
        //        chkConfusedPoor1.Checked = chkHazy1.Checked = chkAnswertoQuestions1.Checked = chkSpeakswithconfidence1.Checked = false;
        //    }
        //    else
        //        chkConciseClearthoughts1.ForeColor = Color.Black;
        //}

        //private void chkNotAdequate1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkNotAdequate1.Checked)
        //    {
        //        chkNotAdequate1.ForeColor = Color.Red;
        //        chkMarginal1.Checked = chkSuitable1.Checked = chkWelqualified1.Checked = chkIdeal1.Checked = false;
        //    }
        //    else
        //        chkNotAdequate1.ForeColor = Color.Black;
        //}

        //private void chkMarginal1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkMarginal1.Checked)
        //    {
        //        chkMarginal1.ForeColor = Color.Red;
        //        chkNotAdequate1.Checked = chkSuitable1.Checked = chkWelqualified1.Checked = chkIdeal1.Checked = false;
        //    }
        //    else
        //        chkMarginal1.ForeColor = Color.Black;
        //}

        //private void chkSuitable1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkSuitable1.Checked)
        //    {
        //        chkSuitable1.ForeColor = Color.Red;
        //        chkNotAdequate1.Checked = chkMarginal1.Checked = chkWelqualified1.Checked = chkIdeal1.Checked = false;
        //    }
        //    else
        //        chkSuitable1.ForeColor = Color.Black;
        //}

        //private void chkWelqualified1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkWelqualified1.Checked)
        //    {
        //        chkWelqualified1.ForeColor = Color.Red;
        //        chkNotAdequate1.Checked = chkMarginal1.Checked = chkSuitable1.Checked = chkIdeal1.Checked = false;
        //    }
        //    else
        //        chkWelqualified1.ForeColor = Color.Black;
        //}

        //private void chkIdeal1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkIdeal1.Checked)
        //    {
        //        chkIdeal1.ForeColor = Color.Red;
        //        chkNotAdequate1.Checked = chkMarginal1.Checked = chkSuitable1.Checked = chkWelqualified1.Checked = false;
        //    }
        //    else
        //        chkIdeal1.ForeColor = Color.Black;
        //}
        //private void chkNone1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkNone1.Checked)
        //    {
        //        chkNone1.ForeColor = Color.Red;
        //        chkNeedsTraning1.Checked = chkBasicKnowledge1.Checked = chkGoodKnowledge1.Checked = chkExcellentKnowledge1.Checked = false;
        //    }
        //    else
        //        chkNone1.ForeColor = Color.Black;
        //}

        //private void chkNeedsTraning1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkNeedsTraning1.Checked)
        //    {
        //        chkNeedsTraning1.ForeColor = Color.Red;
        //        chkBasicKnowledge1.Checked = chkNone1.Checked = chkGoodKnowledge1.Checked = chkExcellentKnowledge1.Checked = false;
        //    }
        //    else
        //        chkNeedsTraning1.ForeColor = Color.Black;
        //}

        //private void chkBasicKnowledge1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkBasicKnowledge1.Checked)
        //    {
        //        chkBasicKnowledge1.ForeColor = Color.Red;
        //        chkNeedsTraning1.Checked = chkNone1.Checked = chkGoodKnowledge1.Checked = chkExcellentKnowledge1.Checked = false;
        //    }
        //    else
        //        chkBasicKnowledge1.ForeColor = Color.Black;

        //}

        //private void chkGoodKnowledge1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkGoodKnowledge1.Checked)
        //    {
        //        chkGoodKnowledge1.ForeColor = Color.Red;
        //        chkNeedsTraning1.Checked = chkNone1.Checked = chkBasicKnowledge1.Checked = chkExcellentKnowledge1.Checked = false;
        //    }
        //    else
        //        chkGoodKnowledge1.ForeColor = Color.Black;
        //}

        //private void chkExcellentKnowledge1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (chkExcellentKnowledge1.Checked)
        //    {
        //        chkExcellentKnowledge1.ForeColor = Color.Red;
        //        chkNeedsTraning1.Checked = chkNone1.Checked = chkBasicKnowledge1.Checked = chkGoodKnowledge1.Checked = false;
        //    }
        //    else
        //        chkExcellentKnowledge1.ForeColor = Color.Black;
        //}









        private void chkSloppy2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkSloppy2.Checked)
            {
                chkSloppy2.ForeColor = Color.Red;
                chkNotOrganized2.Checked = chkFunction2.Checked = chkWellGroomed2.Checked = chkProfessionallooking2.Checked = false;
                chkNotOrganized2.ForeColor = Color.Black;
            }
            else
                chkSloppy2.ForeColor = Color.Black;
        }

        private void chkNotOrganized2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkNotOrganized2.Checked)
            {
                chkNotOrganized2.ForeColor = Color.Red;
                chkSloppy2.Checked = chkFunction2.Checked = chkWellGroomed2.Checked = chkProfessionallooking2.Checked = false;
            }
            else
                chkNotOrganized2.ForeColor = Color.Black;
        }

        private void chkFunction2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkFunction2.Checked)
            {
                chkFunction2.ForeColor = Color.Red;
                chkSloppy2.Checked = chkNotOrganized2.Checked = chkWellGroomed2.Checked = chkProfessionallooking2.Checked = false;
            }
            else
                chkFunction2.ForeColor = Color.Black;
        }

        private void chkWellGroomed2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkWellGroomed2.Checked)
            {
                chkWellGroomed2.ForeColor = Color.Red;
                chkSloppy2.Checked = chkNotOrganized2.Checked = chkFunction2.Checked = chkProfessionallooking2.Checked = false;
            }
            else
                chkWellGroomed2.ForeColor = Color.Black;

        }

        private void chkProfessionallooking2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkProfessionallooking2.Checked)
            {
                chkProfessionallooking2.ForeColor = Color.Red;
                chkSloppy2.Checked = chkNotOrganized2.Checked = chkFunction2.Checked = chkWellGroomed2.Checked = false;
            }
            else
                chkProfessionallooking2.ForeColor = Color.Black;
        }


        private void chkUnpleasant2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkUnpleasant2.Checked)
            {
                chkUnpleasant2.ForeColor = Color.Red;
                chkNeedseffort2.Checked = chkLikeable2.Checked = chkPleasing2.Checked = chkWarmCharming2.Checked = false;
            }
            else
                chkUnpleasant2.ForeColor = Color.Black;
        }

        private void chkNeedseffort2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkNeedseffort2.Checked)
            {
                chkNeedseffort2.ForeColor = Color.Red;
                chkUnpleasant2.Checked = chkLikeable2.Checked = chkPleasing2.Checked = chkWarmCharming2.Checked = false;
            }
            else
                chkNeedseffort2.ForeColor = Color.Black;
        }

        private void chkLikeable2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkLikeable2.Checked)
            {
                chkLikeable2.ForeColor = Color.Red;
                chkUnpleasant2.Checked = chkNeedseffort2.Checked = chkPleasing2.Checked = chkWarmCharming2.Checked = false;
            }
            else
                chkLikeable2.ForeColor = Color.Black;
        }

        private void chkPleasing2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkPleasing2.Checked)
            {
                chkPleasing2.ForeColor = Color.Red;
                chkUnpleasant2.Checked = chkNeedseffort2.Checked = chkLikeable2.Checked = chkWarmCharming2.Checked = false;
            }
            else
                chkPleasing2.ForeColor = Color.Black;
        }

        private void chkWarmCharming2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkWarmCharming2.Checked)
            {
                chkWarmCharming2.ForeColor = Color.Red;
                chkUnpleasant2.Checked = chkNeedseffort2.Checked = chkLikeable2.Checked = chkPleasing2.Checked = false;
            }
            else
                chkWarmCharming2.ForeColor = Color.Black;
        }


        private void chkNodriver2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkNodriver2.Checked)
            {
                chkNodriver2.ForeColor = Color.Red;
                chkDoubtfullInterest2.Checked = chkSincereDesire2.Checked = chkStrongInterest2.Checked = chkHighlymotivated2.Checked = false;
            }
            else
                chkNodriver2.ForeColor = Color.Black;
        }

        private void chkDoubtfullInterest2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkDoubtfullInterest2.Checked)
            {
                chkDoubtfullInterest2.ForeColor = Color.Red;
                chkNodriver2.Checked = chkSincereDesire2.Checked = chkStrongInterest2.Checked = chkHighlymotivated2.Checked = false;
            }
            else
                chkDoubtfullInterest2.ForeColor = Color.Black;
        }

        private void chkSincereDesire2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkSincereDesire2.Checked)
            {
                chkSincereDesire2.ForeColor = Color.Red;
                chkNodriver2.Checked = chkDoubtfullInterest2.Checked = chkStrongInterest2.Checked = chkHighlymotivated2.Checked = false;
            }
            else
                chkSincereDesire2.ForeColor = Color.Black;
        }

        private void chkStrongInterest2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkStrongInterest2.Checked)
            {
                chkStrongInterest2.ForeColor = Color.Red;
                chkNodriver2.Checked = chkDoubtfullInterest2.Checked = chkSincereDesire2.Checked = chkHighlymotivated2.Checked = false;
            }
            else
                chkStrongInterest2.ForeColor = Color.Black;
        }

        private void chkHighlymotivated2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkHighlymotivated2.Checked)
            {
                chkHighlymotivated2.ForeColor = Color.Red;
                chkNodriver2.Checked = chkDoubtfullInterest2.Checked = chkSincereDesire2.Checked = chkStrongInterest2.Checked = false;
            }
            else
                chkHighlymotivated2.ForeColor = Color.Black;
        }

        private void chkConfusedPoor2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkConfusedPoor2.Checked)
            {
                chkConfusedPoor2.ForeColor = Color.Red;
                chkHazy2.Checked = chkAnswertoQuestions2.Checked = chkSpeakswithconfidence2.Checked = chkConciseClearthoughts2.Checked = false;
            }
            else
                chkConfusedPoor2.ForeColor = Color.Black;
        }

        private void chkHazy2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkHazy2.Checked)
            {
                chkHazy2.ForeColor = Color.Red;
                chkConfusedPoor2.Checked = chkAnswertoQuestions2.Checked = chkSpeakswithconfidence2.Checked = chkConciseClearthoughts2.Checked = false;
            }
            else
                chkHazy2.ForeColor = Color.Black;
        }

        private void chkAnswertoQuestions2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkAnswertoQuestions2.Checked)
            {
                chkAnswertoQuestions2.ForeColor = Color.Red;
                chkConfusedPoor2.Checked = chkHazy2.Checked = chkSpeakswithconfidence2.Checked = chkConciseClearthoughts2.Checked = false;
            }
            else
                chkAnswertoQuestions2.ForeColor = Color.Black;
        }

        private void chkSpeakswithconfidence2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkSpeakswithconfidence2.Checked)
            {
                chkSpeakswithconfidence2.ForeColor = Color.Red;
                chkConfusedPoor2.Checked = chkHazy2.Checked = chkAnswertoQuestions2.Checked = chkConciseClearthoughts2.Checked = false;
            }
            else
                chkSpeakswithconfidence2.ForeColor = Color.Black;
        }

        private void chkConciseClearthoughts2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkConciseClearthoughts2.Checked)
            {
                chkConciseClearthoughts2.ForeColor = Color.Red;
                chkConfusedPoor2.Checked = chkHazy2.Checked = chkAnswertoQuestions2.Checked = chkSpeakswithconfidence2.Checked = false;
            }
            else
                chkConciseClearthoughts2.ForeColor = Color.Black;
        }

        private void chkNotAdequate2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkNotAdequate2.Checked)
            {
                chkNotAdequate2.ForeColor = Color.Red;
                chkMarginal2.Checked = chkSuitable2.Checked = chkWelqualified2.Checked = chkIdeal2.Checked = false;
            }
            else
                chkNotAdequate2.ForeColor = Color.Black;
        }

        private void chkMarginal2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkMarginal2.Checked)
            {
                chkMarginal2.ForeColor = Color.Red;
                chkNotAdequate2.Checked = chkSuitable2.Checked = chkWelqualified2.Checked = chkIdeal2.Checked = false;
            }
            else
                chkMarginal2.ForeColor = Color.Black;
        }

        private void chkSuitable2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkSuitable2.Checked)
            {
                chkSuitable2.ForeColor = Color.Red;
                chkNotAdequate2.Checked = chkMarginal2.Checked = chkWelqualified2.Checked = chkIdeal2.Checked = false;
            }
            else
                chkSuitable2.ForeColor = Color.Black;
        }

        private void chkWelqualified2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkWelqualified2.Checked)
            {
                chkWelqualified2.ForeColor = Color.Red;
                chkNotAdequate2.Checked = chkMarginal2.Checked = chkSuitable2.Checked = chkIdeal2.Checked = false;
            }
            else
                chkWelqualified2.ForeColor = Color.Black;
        }

        private void chkIdeal2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkIdeal2.Checked)
            {
                chkIdeal2.ForeColor = Color.Red;
                chkNotAdequate2.Checked = chkMarginal2.Checked = chkSuitable2.Checked = chkWelqualified2.Checked = false;
            }
            else
                chkIdeal2.ForeColor = Color.Black;
        }
        private void chkNone2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkNone2.Checked)
            {
                chkNone2.ForeColor = Color.Red;
                chkNeedsTraning2.Checked = chkBasicKnowledge2.Checked = chkGoodKnowledge2.Checked = chkExcellentKnowledge2.Checked = false;
            }
            else
                chkNone2.ForeColor = Color.Black;
        }

        private void chkNeedsTraning2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkNeedsTraning2.Checked)
            {
                chkNeedsTraning2.ForeColor = Color.Red;
                chkBasicKnowledge2.Checked = chkNone2.Checked = chkGoodKnowledge2.Checked = chkExcellentKnowledge2.Checked = false;
            }
            else
                chkNeedsTraning2.ForeColor = Color.Black;
        }

        private void chkBasicKnowledge2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkBasicKnowledge2.Checked)
            {
                chkBasicKnowledge2.ForeColor = Color.Red;
                chkNeedsTraning2.Checked = chkNone2.Checked = chkGoodKnowledge2.Checked = chkExcellentKnowledge2.Checked = false;
            }
            else
                chkBasicKnowledge2.ForeColor = Color.Black;

        }

        private void chkGoodKnowledge2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkGoodKnowledge2.Checked)
            {
                chkGoodKnowledge2.ForeColor = Color.Red;
                chkNeedsTraning2.Checked = chkNone2.Checked = chkBasicKnowledge2.Checked = chkExcellentKnowledge2.Checked = false;
            }
            else
                chkGoodKnowledge2.ForeColor = Color.Black;
        }

        private void chkExcellentKnowledge2_CheckedChanged(object sender, EventArgs e)
        {
            if (chkExcellentKnowledge2.Checked)
            {
                chkExcellentKnowledge2.ForeColor = Color.Red;
                chkNeedsTraning2.Checked = chkNone2.Checked = chkBasicKnowledge2.Checked = chkGoodKnowledge2.Checked = false;
            }
            else
                chkExcellentKnowledge2.ForeColor = Color.Black;
        }









        private void chkSloppy3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkSloppy3.Checked)
            {
                chkSloppy3.ForeColor = Color.Red;
                chkNotOrganized3.Checked = chkFunction3.Checked = chkWellGroomed3.Checked = chkProfessionallooking3.Checked = false;
                chkNotOrganized3.ForeColor = Color.Black;
            }
            else
                chkSloppy3.ForeColor = Color.Black;
        }

        private void chkNotOrganized3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkNotOrganized3.Checked)
            {
                chkNotOrganized3.ForeColor = Color.Red;
                chkSloppy3.Checked = chkFunction3.Checked = chkWellGroomed3.Checked = chkProfessionallooking3.Checked = false;
            }
            else
                chkNotOrganized3.ForeColor = Color.Black;
        }

        private void chkFunction3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkFunction3.Checked)
            {
                chkFunction3.ForeColor = Color.Red;
                chkSloppy3.Checked = chkNotOrganized3.Checked = chkWellGroomed3.Checked = chkProfessionallooking3.Checked = false;
            }
            else
                chkFunction3.ForeColor = Color.Black;
        }

        private void chkWellGroomed3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkWellGroomed3.Checked)
            {
                chkWellGroomed3.ForeColor = Color.Red;
                chkSloppy3.Checked = chkNotOrganized3.Checked = chkFunction3.Checked = chkProfessionallooking3.Checked = false;
            }
            else
                chkWellGroomed3.ForeColor = Color.Black;

        }

        private void chkProfessionallooking3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkProfessionallooking3.Checked)
            {
                chkProfessionallooking3.ForeColor = Color.Red;
                chkSloppy3.Checked = chkNotOrganized3.Checked = chkFunction3.Checked = chkWellGroomed3.Checked = false;
            }
            else
                chkProfessionallooking3.ForeColor = Color.Black;
        }


        private void chkUnpleasant3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkUnpleasant3.Checked)
            {
                chkUnpleasant3.ForeColor = Color.Red;
                chkNeedseffort3.Checked = chkLikeable3.Checked = chkPleasing3.Checked = chkWarmCharming3.Checked = false;
            }
            else
                chkUnpleasant3.ForeColor = Color.Black;
        }

        private void chkNeedseffort3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkNeedseffort3.Checked)
            {
                chkNeedseffort3.ForeColor = Color.Red;
                chkUnpleasant3.Checked = chkLikeable3.Checked = chkPleasing3.Checked = chkWarmCharming3.Checked = false;
            }
            else
                chkNeedseffort3.ForeColor = Color.Black;
        }

        private void chkLikeable3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkLikeable3.Checked)
            {
                chkLikeable3.ForeColor = Color.Red;
                chkUnpleasant3.Checked = chkNeedseffort3.Checked = chkPleasing3.Checked = chkWarmCharming3.Checked = false;
            }
            else
                chkLikeable3.ForeColor = Color.Black;
        }

        private void chkPleasing3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkPleasing3.Checked)
            {
                chkPleasing3.ForeColor = Color.Red;
                chkUnpleasant3.Checked = chkNeedseffort3.Checked = chkLikeable3.Checked = chkWarmCharming3.Checked = false;
            }
            else
                chkPleasing3.ForeColor = Color.Black;
        }

        private void chkWarmCharming3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkWarmCharming3.Checked)
            {
                chkWarmCharming3.ForeColor = Color.Red;
                chkUnpleasant3.Checked = chkNeedseffort3.Checked = chkLikeable3.Checked = chkPleasing3.Checked = false;
            }
            else
                chkWarmCharming3.ForeColor = Color.Black;
        }


        private void chkNodriver3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkNodriver3.Checked)
            {
                chkNodriver3.ForeColor = Color.Red;
                chkDoubtfullInterest3.Checked = chkSincereDesire3.Checked = chkStrongInterest3.Checked = chkHighlymotivated3.Checked = false;
            }
            else
                chkNodriver3.ForeColor = Color.Black;
        }

        private void chkDoubtfullInterest3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkDoubtfullInterest3.Checked)
            {
                chkDoubtfullInterest3.ForeColor = Color.Red;
                chkNodriver3.Checked = chkSincereDesire3.Checked = chkStrongInterest3.Checked = chkHighlymotivated3.Checked = false;
            }
            else
                chkDoubtfullInterest3.ForeColor = Color.Black;
        }

        private void chkSincereDesire3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkSincereDesire3.Checked)
            {
                chkSincereDesire3.ForeColor = Color.Red;
                chkNodriver3.Checked = chkDoubtfullInterest3.Checked = chkStrongInterest3.Checked = chkHighlymotivated3.Checked = false;
            }
            else
                chkSincereDesire3.ForeColor = Color.Black;
        }

        private void chkStrongInterest3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkStrongInterest3.Checked)
            {
                chkStrongInterest3.ForeColor = Color.Red;
                chkNodriver3.Checked = chkDoubtfullInterest3.Checked = chkSincereDesire3.Checked = chkHighlymotivated3.Checked = false;
            }
            else
                chkStrongInterest3.ForeColor = Color.Black;
        }

        private void chkHighlymotivated3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkHighlymotivated3.Checked)
            {
                chkHighlymotivated3.ForeColor = Color.Red;
                chkNodriver3.Checked = chkDoubtfullInterest3.Checked = chkSincereDesire3.Checked = chkStrongInterest3.Checked = false;
            }
            else
                chkHighlymotivated3.ForeColor = Color.Black;
        }

        private void chkConfusedPoor3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkConfusedPoor3.Checked)
            {
                chkConfusedPoor3.ForeColor = Color.Red;
                chkHazy3.Checked = chkAnswertoQuestions3.Checked = chkSpeakswithconfidence3.Checked = chkConciseClearthoughts3.Checked = false;
            }
            else
                chkConfusedPoor3.ForeColor = Color.Black;
        }

        private void chkHazy3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkHazy3.Checked)
            {
                chkHazy3.ForeColor = Color.Red;
                chkConfusedPoor3.Checked = chkAnswertoQuestions3.Checked = chkSpeakswithconfidence3.Checked = chkConciseClearthoughts3.Checked = false;
            }
            else
                chkHazy3.ForeColor = Color.Black;
        }

        private void chkAnswertoQuestions3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkAnswertoQuestions3.Checked)
            {
                chkAnswertoQuestions3.ForeColor = Color.Red;
                chkConfusedPoor3.Checked = chkHazy3.Checked = chkSpeakswithconfidence3.Checked = chkConciseClearthoughts3.Checked = false;
            }
            else
                chkAnswertoQuestions3.ForeColor = Color.Black;
        }

        private void chkSpeakswithconfidence3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkSpeakswithconfidence3.Checked)
            {
                chkSpeakswithconfidence3.ForeColor = Color.Red;
                chkConfusedPoor3.Checked = chkHazy3.Checked = chkAnswertoQuestions3.Checked = chkConciseClearthoughts3.Checked = false;
            }
            else
                chkSpeakswithconfidence3.ForeColor = Color.Black;
        }

        private void chkConciseClearthoughts3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkConciseClearthoughts3.Checked)
            {
                chkConciseClearthoughts3.ForeColor = Color.Red;
                chkConfusedPoor3.Checked = chkHazy3.Checked = chkAnswertoQuestions3.Checked = chkSpeakswithconfidence3.Checked = false;
            }
            else
                chkConciseClearthoughts3.ForeColor = Color.Black;
        }

        private void chkNotAdequate3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkNotAdequate3.Checked)
            {
                chkNotAdequate3.ForeColor = Color.Red;
                chkMarginal3.Checked = chkSuitable3.Checked = chkWelqualified3.Checked = chkIdeal3.Checked = false;
            }
            else
                chkNotAdequate3.ForeColor = Color.Black;
        }

        private void chkMarginal3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkMarginal3.Checked)
            {
                chkMarginal3.ForeColor = Color.Red;
                chkNotAdequate3.Checked = chkSuitable3.Checked = chkWelqualified3.Checked = chkIdeal3.Checked = false;
            }
            else
                chkMarginal3.ForeColor = Color.Black;
        }

        private void chkSuitable3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkSuitable3.Checked)
            {
                chkSuitable3.ForeColor = Color.Red;
                chkNotAdequate3.Checked = chkMarginal3.Checked = chkWelqualified3.Checked = chkIdeal3.Checked = false;
            }
            else
                chkSuitable3.ForeColor = Color.Black;
        }

        private void chkWelqualified3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkWelqualified3.Checked)
            {
                chkWelqualified3.ForeColor = Color.Red;
                chkNotAdequate3.Checked = chkMarginal3.Checked = chkSuitable3.Checked = chkIdeal3.Checked = false;
            }
            else
                chkWelqualified3.ForeColor = Color.Black;
        }

        private void chkIdeal3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkIdeal3.Checked)
            {
                chkIdeal3.ForeColor = Color.Red;
                chkNotAdequate3.Checked = chkMarginal3.Checked = chkSuitable3.Checked = chkWelqualified3.Checked = false;
            }
            else
                chkIdeal3.ForeColor = Color.Black;
        }
        private void chkNone3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkNone3.Checked)
            {
                chkNone3.ForeColor = Color.Red;
                chkNeedsTraning3.Checked = chkBasicKnowledge3.Checked = chkGoodKnowledge3.Checked = chkExcellentKnowledge3.Checked = false;
            }
            else
                chkNone3.ForeColor = Color.Black;
        }

        private void chkNeedsTraning3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkNeedsTraning3.Checked)
            {
                chkNeedsTraning3.ForeColor = Color.Red;
                chkBasicKnowledge3.Checked = chkNone3.Checked = chkGoodKnowledge3.Checked = chkExcellentKnowledge3.Checked = false;
            }
            else
                chkNeedsTraning3.ForeColor = Color.Black;
        }

        private void chkBasicKnowledge3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkBasicKnowledge3.Checked)
            {
                chkBasicKnowledge3.ForeColor = Color.Red;
                chkNeedsTraning3.Checked = chkNone3.Checked = chkGoodKnowledge3.Checked = chkExcellentKnowledge3.Checked = false;
            }
            else
                chkBasicKnowledge3.ForeColor = Color.Black;

        }

        private void chkGoodKnowledge3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkGoodKnowledge3.Checked)
            {
                chkGoodKnowledge3.ForeColor = Color.Red;
                chkNeedsTraning3.Checked = chkNone3.Checked = chkBasicKnowledge3.Checked = chkExcellentKnowledge3.Checked = false;
            }
            else
                chkGoodKnowledge3.ForeColor = Color.Black;
        }

        private void chkExcellentKnowledge3_CheckedChanged(object sender, EventArgs e)
        {
            if (chkExcellentKnowledge3.Checked)
            {
                chkExcellentKnowledge3.ForeColor = Color.Red;
                chkNeedsTraning3.Checked = chkNone3.Checked = chkBasicKnowledge3.Checked = chkGoodKnowledge3.Checked = false;
            }
            else
                chkExcellentKnowledge3.ForeColor = Color.Black;
        }
        #endregion

        private void btnPrint_Click(object sender, EventArgs e)
        {
            if (!listRole.Print)
            {
                MessageBox.Show("Không có quyền in", UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            else
            {
                frmPreviewReport f = new frmPreviewReport("DanhGiaUngVien", new string[] { _CandidateInfo.ID.ToString(), _RecruitmentID.ToString() });
                f.ShowDialog();
            }
        }




    }
}
